- dhcp: web handlers were not registered when DHCP server is disabled
So there was no way to enable DHCP from UI
This commit is contained in:
parent
c8285c41d7
commit
4370490138
@ -124,6 +124,11 @@ func Create(config ServerConfig) *Server {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !webHandlersRegistered && s.conf.HTTPRegister != nil {
|
||||||
|
webHandlersRegistered = true
|
||||||
|
s.registerHandlers()
|
||||||
|
}
|
||||||
|
|
||||||
// we can't delay database loading until DHCP server is started,
|
// we can't delay database loading until DHCP server is started,
|
||||||
// because we need static leases functionality available beforehand
|
// because we need static leases functionality available beforehand
|
||||||
s.dbLoad()
|
s.dbLoad()
|
||||||
@ -219,12 +224,6 @@ func (s *Server) setConfig(config ServerConfig) error {
|
|||||||
|
|
||||||
// Start will listen on port 67 and serve DHCP requests.
|
// Start will listen on port 67 and serve DHCP requests.
|
||||||
func (s *Server) Start() error {
|
func (s *Server) Start() error {
|
||||||
|
|
||||||
if !webHandlersRegistered && s.conf.HTTPRegister != nil {
|
|
||||||
webHandlersRegistered = true
|
|
||||||
s.registerHandlers()
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: don't close if interface and addresses are the same
|
// TODO: don't close if interface and addresses are the same
|
||||||
if s.conn != nil {
|
if s.conn != nil {
|
||||||
s.closeConn()
|
s.closeConn()
|
||||||
|
Loading…
Reference in New Issue
Block a user