Skip to content

Commit

Permalink
dnsforward: add todo
Browse files Browse the repository at this point in the history
  • Loading branch information
schzhn committed Mar 1, 2023
1 parent e1978ad commit 6545543
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 4 additions & 3 deletions internal/dnsforward/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions internal/dnsforward/dns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
},
Expand Down

0 comments on commit 6545543

Please sign in to comment.