initSubnets sets the DNS64 configuration into conf. TODO(d.kolyshev): Join errors.
(proxyConf *proxy.Config)
| 481 | // |
| 482 | // TODO(d.kolyshev): Join errors. |
| 483 | func (conf *configuration) initSubnets(proxyConf *proxy.Config) (err error) { |
| 484 | if proxyConf.UseDNS64 = conf.DNS64; proxyConf.UseDNS64 { |
| 485 | for i, p := range conf.DNS64Prefix { |
| 486 | var pref netip.Prefix |
| 487 | pref, err = netip.ParsePrefix(p) |
| 488 | if err != nil { |
| 489 | return fmt.Errorf("parsing dns64 prefix at index %d: %w", i, err) |
| 490 | } |
| 491 | |
| 492 | proxyConf.DNS64Prefs = append(proxyConf.DNS64Prefs, pref) |
| 493 | } |
| 494 | } |
| 495 | |
| 496 | if !conf.UsePrivateRDNS { |
| 497 | return nil |
| 498 | } |
| 499 | |
| 500 | return conf.initPrivateSubnets(proxyConf) |
| 501 | } |
| 502 | |
| 503 | // initSubnets sets the private subnets configuration into conf. |
| 504 | func (conf *configuration) initPrivateSubnets(proxyConf *proxy.Config) (err error) { |
no test coverage detected