+ DHCP: On-disk database for lease table

This commit is contained in:
Simon Zolin
2019-03-05 17:15:38 +03:00
parent a2e9d69452
commit 67014c40f7
3 changed files with 146 additions and 0 deletions

View File

@@ -122,6 +122,8 @@ func (s *Server) Start(config *ServerConfig) error {
s.closeConn()
}
s.dbLoad()
c, err := newFilterConn(*iface, ":67") // it has to be bound to 0.0.0.0:67, otherwise it won't see DHCP discover/request packets
if err != nil {
return wrapErrPrint(err, "Couldn't start listening socket on 0.0.0.0:67")
@@ -153,6 +155,7 @@ func (s *Server) Stop() error {
return wrapErrPrint(err, "Couldn't close UDP listening socket")
}
s.dbStore()
return nil
}