net/dns: move directManager function below directManager's definition.

Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
David Anderson 2021-10-06 17:00:47 -07:00 committed by Dave Anderson
parent 422ea4980f
commit 04d24d3a38

View File

@ -76,14 +76,6 @@ func readResolv(r io.Reader) (config OSConfig, err error) {
return config, nil 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 // resolvOwner returns the apparent owner of the resolv.conf
// configuration in bs - one of "resolvconf", "systemd-resolved" or // configuration in bs - one of "resolvconf", "systemd-resolved" or
// "NetworkManager", or "" if no known owner was found. // "NetworkManager", or "" if no known owner was found.
@ -152,6 +144,14 @@ func newDirectManagerOnFS(fs wholeFileFS) directManager {
return directManager{fs: fs} 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 // ownedByTailscale reports whether /etc/resolv.conf seems to be a
// tailscale-managed file. // tailscale-managed file.
func (m directManager) ownedByTailscale() (bool, error) { func (m directManager) ownedByTailscale() (bool, error) {