* dhcpd: minor improvements

This commit is contained in:
Simon Zolin
2019-05-14 14:50:47 +03:00
parent fd593f5282
commit 342699d933
2 changed files with 13 additions and 9 deletions

View File

@@ -286,11 +286,6 @@ func (s *Server) findExpiredLease() int {
}
func (s *Server) findFreeIP(hwaddr net.HardwareAddr) (net.IP, error) {
// if IP pool is nil, lazy initialize it
if s.IPpool == nil {
s.IPpool = make(map[[4]byte]net.HardwareAddr)
}
// go from start to end, find unreserved IP
var foundIP net.IP
for i := 0; i < dhcp4.IPRange(s.leaseStart, s.leaseStop); i++ {