From 65455430993e4a62c49e1f45def909b0a135af3b Mon Sep 17 00:00:00 2001 From: Stanislav Chzhen Date: Wed, 1 Mar 2023 15:37:17 +0300 Subject: [PATCH] dnsforward: add todo --- internal/dnsforward/config.go | 7 ++++--- internal/dnsforward/dns_test.go | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) 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}, },