cmd/lopower: force AAAA records in DNS server

Change-Id: I79582e4ffd468c217df3e8c02bbf65d911a4f0fe
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2024-11-03 11:52:50 -08:00
committed by Anton Tolchanov
parent 89d042d6e5
commit ddc5d14d09
6 changed files with 46 additions and 10 deletions

View File

@@ -66,7 +66,8 @@ type Manager struct {
mu sync.Mutex // guards following
// config is the last configuration we successfully compiled or nil if there
// was any failure applying the last configuration.
config *Config
config *Config
forceAAAA bool // whether client wants MagicDNS AAAA even if unsure of host's IPv6 status
}
// NewManagers created a new manager from the given config.
@@ -148,6 +149,18 @@ func (m *Manager) GetBaseConfig() (OSConfig, error) {
return m.os.GetBaseConfig()
}
func (m *Manager) GetForceAAAA() bool {
m.mu.Lock()
defer m.mu.Unlock()
return m.forceAAAA
}
func (m *Manager) SetForceAAAA(v bool) {
m.mu.Lock()
defer m.mu.Unlock()
m.forceAAAA = v
}
// setLocked sets the DNS configuration.
//
// m.mu must be held.