diff --git a/internal/dnsforward/config.go b/internal/dnsforward/config.go index 6648013ee17..f18e751304b 100644 --- a/internal/dnsforward/config.go +++ b/internal/dnsforward/config.go @@ -341,9 +341,10 @@ func (s *Server) createProxyConfig() (conf proxy.Config, err error) { if srvConf.EDNSClientSubnet.UseCustom { // TODO(s.chzhen): Add wrapper around netip.Addr. - ip, perr := netutil.ParseIP(srvConf.EDNSClientSubnet.CustomIP) - if perr != nil { - return conf, fmt.Errorf("edns: %w", perr) + var ip net.IP + ip, err = netutil.ParseIP(srvConf.EDNSClientSubnet.CustomIP) + if err != nil { + return conf, fmt.Errorf("edns: %w", err) } // TODO(s.chzhen): Use netip.Addr instead of net.IP inside dnsproxy. diff --git a/internal/dnsforward/dns_test.go b/internal/dnsforward/dns_test.go index 076d3c06258..02f1eb61a90 100644 --- a/internal/dnsforward/dns_test.go +++ b/internal/dnsforward/dns_test.go @@ -467,6 +467,8 @@ func TestServer_ProcessRestrictLocal(t *testing.T) { s := createTestServer(t, &filtering.Config{}, ServerConfig{ UDPListenAddrs: []*net.UDPAddr{{}}, TCPListenAddrs: []*net.TCPAddr{{}}, + // TODO(s.chzhen): Add tests where EDNSClientSubnet.Enabled is true. + // Improve FilteringConfig declaration for tests. FilteringConfig: FilteringConfig{ EDNSClientSubnet: &EDNSClientSubnet{Enabled: false}, },