From 223fb5bbdd2a2c060abbf71422d123848e63d8bf Mon Sep 17 00:00:00 2001 From: Michael Ben-Ami Date: Thu, 7 Aug 2025 12:23:13 -0400 Subject: [PATCH] better docstrings, try to appease linter in test file Signed-off-by: Michael Ben-Ami --- ipn/ipnlocal/local_test.go | 3 --- tailcfg/tailcfg.go | 11 ++++++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ipn/ipnlocal/local_test.go b/ipn/ipnlocal/local_test.go index 5cfe9d01c..40e2567a7 100644 --- a/ipn/ipnlocal/local_test.go +++ b/ipn/ipnlocal/local_test.go @@ -2122,7 +2122,6 @@ func TestDNSConfigForNetmapForExitNodeConfigs(t *testing.T) { "empty.example.com.": []*dnstype.Resolver{}, "route.example.com.": {{Addr: "route.example.com"}}, } - _ = containsEmptyRoutes containsFlaggedRoutes := map[dnsname.FQDN][]*dnstype.Resolver{ "route.example.com.": {{Addr: "route.example.com"}}, "withexit.example.com.": {{Addr: tsUseWithExitNodeResolverAddr}}, @@ -2132,7 +2131,6 @@ func TestDNSConfigForNetmapForExitNodeConfigs(t *testing.T) { "route.example.com.": {{Addr: "route.example.com"}}, "withexit.example.com.": {{Addr: tsUseWithExitNodeResolverAddr}}, } - _ = containsFlaggedAndEmptyRoutes flaggedRoutes := map[dnsname.FQDN][]*dnstype.Resolver{ "withexit.example.com.": {{Addr: tsUseWithExitNodeResolverAddr}}, } @@ -2143,7 +2141,6 @@ func TestDNSConfigForNetmapForExitNodeConfigs(t *testing.T) { "empty.example.com.": []*dnstype.Resolver{}, "withexit.example.com.": {{Addr: tsUseWithExitNodeResolverAddr}}, } - _ = flaggedAndEmptyRoutes stringifyRoutes := func(routes map[dnsname.FQDN][]*dnstype.Resolver) map[string][]*tailcfg.DNSResolver { if routes == nil { diff --git a/tailcfg/tailcfg.go b/tailcfg/tailcfg.go index f530d97dd..884564346 100644 --- a/tailcfg/tailcfg.go +++ b/tailcfg/tailcfg.go @@ -1699,11 +1699,16 @@ var FilterAllowAll = []FilterRule{ }, } -// DNSResolver embeds dnstype.Resolver and stores -// additional configuration. +// DNSResolver describes a single DNS resolver and any special handling needed when +// using that resolver. type DNSResolver struct { dnstype.Resolver `json:",omitempty"` - UseWithExitNode bool `json:",omitempty"` + + // UseWithExitNode designates that this resolver should continue to be used when an + // exit node is in use. Normally, DNS resolution is delegated to the exit node but + // there are situations where it is preferable to still use a Split DNS server and/or + // global DNS server instead of the exit node. + UseWithExitNode bool `json:",omitempty"` } // DNSConfig is the DNS configuration.