- DHCP: fix crash after adding static lease which replaces the dynamic one

This commit is contained in:
Simon Zolin 2020-08-25 13:38:52 +03:00
parent 719ef16b93
commit 06af130bb7
2 changed files with 6 additions and 0 deletions

View File

@ -146,6 +146,9 @@ func (s *v4Server) rmDynamicLease(lease Lease) error {
} }
s.leaseRemoveSwapByIndex(i) s.leaseRemoveSwapByIndex(i)
if i == len(s.leases) {
break
}
l = s.leases[i] l = s.leases[i]
} }

View File

@ -134,6 +134,9 @@ func (s *v6Server) rmDynamicLease(lease Lease) error {
} }
s.leaseRemoveSwapByIndex(i) s.leaseRemoveSwapByIndex(i)
if i == len(s.leases) {
break
}
l = s.leases[i] l = s.leases[i]
} }