Merge: - dhcp: crash on error on startup

Squashed commit of the following:

commit 81908b636ec91a562b3ff8634b77c71dc3f009e4
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Fri Mar 13 17:25:36 2020 +0300

    - dhcp: crash on error on startup
This commit is contained in:
Simon Zolin 2020-03-13 17:30:09 +03:00
parent fa07809189
commit 480c6ac753
1 changed files with 3 additions and 0 deletions

View File

@ -192,6 +192,9 @@ func run(args options) {
config.DHCP.HTTPRegister = httpRegister
config.DHCP.ConfigModified = onConfigModified
Context.dhcpServer = dhcpd.Create(config.DHCP)
if Context.dhcpServer == nil {
os.Exit(1)
}
Context.clients.Init(config.Clients, Context.dhcpServer)
config.Clients = nil