Only set serveDns if the host is also configured to be a lighthouse. (#433)

This commit is contained in:
brad-defined
2021-04-16 14:33:56 -04:00
committed by GitHub
parent 17106f83a0
commit 7859140711
2 changed files with 10 additions and 2 deletions

10
main.go
View File

@ -341,7 +341,15 @@ func Main(config *Config, configTest bool, buildVersion string, logger *logrus.L
//handshakeMACKey := config.GetString("handshake_mac.key", "")
//handshakeAcceptedMACKeys := config.GetStringSlice("handshake_mac.accepted_keys", []string{})
serveDns := config.GetBool("lighthouse.serve_dns", false)
serveDns := false
if config.GetBool("lighthouse.serve_dns", false) {
if config.GetBool("lighthouse.am_lighthouse", false) {
serveDns = true
} else {
l.Warn("DNS server refusing to run because this host is not a lighthouse.")
}
}
checkInterval := config.GetInt("timers.connection_alive_interval", 5)
pendingDeletionInterval := config.GetInt("timers.pending_deletion_interval", 10)
ifConfig := &InterfaceConfig{