wgengine: move DNS configuration out of wgengine/router.
Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
committed by
Dave Anderson
parent
7183e1f052
commit
4c61ebacf4
+4
-3
@@ -33,11 +33,11 @@ type Manager struct {
|
||||
}
|
||||
|
||||
// NewManagers created a new manager from the given config.
|
||||
func NewManager(logf logger.Logf, interfaceName string) *Manager {
|
||||
func NewManager(logf logger.Logf, oscfg OSConfigurator) *Manager {
|
||||
logf = logger.WithPrefix(logf, "dns: ")
|
||||
m := &Manager{
|
||||
logf: logf,
|
||||
impl: newManager(logf, interfaceName),
|
||||
impl: oscfg,
|
||||
}
|
||||
|
||||
m.logf("using %T", m.impl)
|
||||
@@ -81,7 +81,8 @@ func (m *Manager) Down() error {
|
||||
// in case the Tailscale daemon terminated without closing the router.
|
||||
// No other state needs to be instantiated before this runs.
|
||||
func Cleanup(logf logger.Logf, interfaceName string) {
|
||||
dns := NewManager(logf, interfaceName)
|
||||
oscfg := NewOSConfigurator(logf, interfaceName)
|
||||
dns := NewManager(logf, oscfg)
|
||||
if err := dns.Down(); err != nil {
|
||||
logf("dns down: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user