* dhcp,clients: DHCP server module is passed to Clients module during initialization.

This commit is contained in:
Simon Zolin
2019-11-22 14:21:08 +03:00
parent 127a68a39f
commit 149fcc0f2d
5 changed files with 38 additions and 8 deletions

View File

@@ -67,7 +67,7 @@ type configuration struct {
dnsctx dnsContext
dnsFilter *dnsfilter.Dnsfilter
dnsServer *dnsforward.Server
dhcpServer dhcpd.Server
dhcpServer *dhcpd.Server
httpServer *http.Server
httpsServer HTTPSServer
@@ -325,6 +325,12 @@ func (c *configuration) write() error {
config.DNS.DnsfilterConf = c
}
if config.dhcpServer != nil {
c := dhcpd.ServerConfig{}
config.dhcpServer.WriteDiskConfig(&c)
config.DHCP = c
}
configFile := config.getConfigFilename()
log.Debug("Writing YAML file: %s", configFile)
yamlText, err := yaml.Marshal(&config)