Don't try to start DHCP server if it's not enabled.

This commit is contained in:
Eugene Bujak 2018-12-29 15:04:14 +03:00
parent 55a7ff7447
commit 7ab03e9335

View File

@ -137,6 +137,10 @@ func handleDHCPFindActiveServer(w http.ResponseWriter, r *http.Request) {
}
func startDHCPServer() error {
if config.DHCP.Enabled == false {
// not enabled, don't do anything
return nil
}
err := dhcpServer.Start(&config.DHCP)
if err != nil {
return errorx.Decorate(err, "Couldn't start DHCP server")