diff --git a/net/dns/direct.go b/net/dns/direct.go index dcf18e622..f42a83803 100644 --- a/net/dns/direct.go +++ b/net/dns/direct.go @@ -76,14 +76,6 @@ func readResolv(r io.Reader) (config OSConfig, err error) { return config, nil } -func (m directManager) readResolvFile(path string) (OSConfig, error) { - b, err := m.fs.ReadFile(path) - if err != nil { - return OSConfig{}, err - } - return readResolv(bytes.NewReader(b)) -} - // resolvOwner returns the apparent owner of the resolv.conf // configuration in bs - one of "resolvconf", "systemd-resolved" or // "NetworkManager", or "" if no known owner was found. @@ -152,6 +144,14 @@ func newDirectManagerOnFS(fs wholeFileFS) directManager { return directManager{fs: fs} } +func (m directManager) readResolvFile(path string) (OSConfig, error) { + b, err := m.fs.ReadFile(path) + if err != nil { + return OSConfig{}, err + } + return readResolv(bytes.NewReader(b)) +} + // ownedByTailscale reports whether /etc/resolv.conf seems to be a // tailscale-managed file. func (m directManager) ownedByTailscale() (bool, error) {