diff --git a/net/dns/config.go b/net/dns/config.go index e89eda86e..884d9284c 100644 --- a/net/dns/config.go +++ b/net/dns/config.go @@ -63,7 +63,4 @@ type ManagerConfig struct { Logf logger.Logf // InterfaceName is the name of the interface with which DNS settings should be associated. InterfaceName string - // Cleanup indicates that the manager is created for cleanup only. - // A no-op manager will be instantiated if the system needs no cleanup. - Cleanup bool } diff --git a/net/dns/manager.go b/net/dns/manager.go index 6e6d4cd92..60a790bb0 100644 --- a/net/dns/manager.go +++ b/net/dns/manager.go @@ -94,7 +94,6 @@ func Cleanup(logf logger.Logf, interfaceName string) { mconfig := ManagerConfig{ Logf: logf, InterfaceName: interfaceName, - Cleanup: true, } dns := NewManager(mconfig) if err := dns.Down(); err != nil { diff --git a/net/dns/manager_linux.go b/net/dns/manager_linux.go index 6f995d4bf..51841219c 100644 --- a/net/dns/manager_linux.go +++ b/net/dns/manager_linux.go @@ -7,17 +7,9 @@ package dns func newManager(mconfig ManagerConfig) managerImpl { switch { case isResolvedActive(): - if mconfig.Cleanup { - return newNoopManager(mconfig) - } else { - return newResolvedManager(mconfig) - } + return newResolvedManager(mconfig) case isNMActive(): - if mconfig.Cleanup { - return newNoopManager(mconfig) - } else { - return newNMManager(mconfig) - } + return newNMManager(mconfig) case isResolvconfActive(): return newResolvconfManager(mconfig) default: diff --git a/net/dns/noop.go b/net/dns/noop.go deleted file mode 100644 index 35c07a232..000000000 --- a/net/dns/noop.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) 2020 Tailscale Inc & AUTHORS All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package dns - -type noopManager struct{} - -// Up implements managerImpl. -func (m noopManager) Up(Config) error { return nil } - -// Down implements managerImpl. -func (m noopManager) Down() error { return nil } - -func newNoopManager(mconfig ManagerConfig) managerImpl { - return noopManager{} -}