mirror of
https://github.com/tailscale/tailscale.git
synced 2025-03-27 03:22:25 +00:00
net/dns: rename impl to os.
Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
parent
c4530971db
commit
6a206fd0fb
@ -27,7 +27,7 @@ const reconfigTimeout = time.Second
|
||||
type Manager struct {
|
||||
logf logger.Logf
|
||||
|
||||
impl OSConfigurator
|
||||
os OSConfigurator
|
||||
|
||||
config OSConfig
|
||||
}
|
||||
@ -37,10 +37,10 @@ func NewManager(logf logger.Logf, oscfg OSConfigurator) *Manager {
|
||||
logf = logger.WithPrefix(logf, "dns: ")
|
||||
m := &Manager{
|
||||
logf: logf,
|
||||
impl: oscfg,
|
||||
os: oscfg,
|
||||
}
|
||||
|
||||
m.logf("using %T", m.impl)
|
||||
m.logf("using %T", m.os)
|
||||
return m
|
||||
}
|
||||
|
||||
@ -52,7 +52,7 @@ func (m *Manager) Set(config OSConfig) error {
|
||||
m.logf("Set: %+v", config)
|
||||
|
||||
if len(config.Nameservers) == 0 {
|
||||
err := m.impl.Set(OSConfig{})
|
||||
err := m.os.Set(OSConfig{})
|
||||
// If we save the config, we will not retry next time. Only do this on success.
|
||||
if err == nil {
|
||||
m.config = config
|
||||
@ -60,7 +60,7 @@ func (m *Manager) Set(config OSConfig) error {
|
||||
return err
|
||||
}
|
||||
|
||||
err := m.impl.Set(config)
|
||||
err := m.os.Set(config)
|
||||
// If we save the config, we will not retry next time. Only do this on success.
|
||||
if err == nil {
|
||||
m.config = config
|
||||
@ -70,11 +70,11 @@ func (m *Manager) Set(config OSConfig) error {
|
||||
}
|
||||
|
||||
func (m *Manager) Up() error {
|
||||
return m.impl.Set(m.config)
|
||||
return m.os.Set(m.config)
|
||||
}
|
||||
|
||||
func (m *Manager) Down() error {
|
||||
return m.impl.Close()
|
||||
return m.os.Close()
|
||||
}
|
||||
|
||||
// Cleanup restores the system DNS configuration to its original state
|
||||
|
Loading…
x
Reference in New Issue
Block a user