Pull request: dhcpd: imp static lease validation

Closes #2838.
Updates #2834.

Squashed commit of the following:

commit 608dce28cf6bcbaf5a7f0bf499889ec25777e121
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Thu Mar 18 16:49:20 2021 +0300

    dhcpd: fix windows; imp code

commit 5e56eebf6ab85ca5fd0a0278c312674d921a3077
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Wed Mar 17 18:47:54 2021 +0300

    dhcpd: imp static lease validation
This commit is contained in:
Ainar Garipov
2021-03-18 17:07:13 +03:00
parent ffa0afae27
commit eb9526cc92
15 changed files with 392 additions and 121 deletions

View File

@@ -93,7 +93,7 @@ func (r *ipRange) find(p ipPredicate) (ip net.IP) {
// offset returns the offset of ip from the beginning of r. It returns 0 and
// false if ip is not in r.
func (r *ipRange) offset(ip net.IP) (offset uint, ok bool) {
func (r *ipRange) offset(ip net.IP) (offset uint64, ok bool) {
if r == nil {
return 0, false
}
@@ -108,5 +108,5 @@ func (r *ipRange) offset(ip net.IP) (offset uint, ok bool) {
// Assume that the range was checked against maxRangeLen during
// construction.
return uint(offsetInt.Uint64()), true
return offsetInt.Uint64(), true
}