Commit e27bd27
committed
dhcp: allow reserved leases outside scope pool range but within subnet
Reserved DHCP leases whose IP is outside the scope's [startingAddress,
endingAddress] pool range but still inside the scope's subnet were rejected on
add and, when added via the API back door, failed unicast renewal.
- Scope: validate reserved-lease addresses by subnet membership
(IsAddressInNetwork) instead of pool range (IsAddressInRange), in both the
ReservedLeases setter and TryAddReservedLease so the console form and API
agree. Wrong-subnet addresses are still rejected.
- DhcpServer.FindScope: in the no-relay unicast (RENEW/REBIND) branch, match the
scope by the client's reserved lease (keyed on MAC) before the pool-range
check, mirroring the broadcast and relay branches. Previously an out-of-pool
ciaddr matched no scope, so the REQUEST was silently dropped and the client
lost its lease at T1.1 parent d0484b6 commit e27bd27
2 files changed
Lines changed: 13 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
655 | 655 | | |
656 | 656 | | |
657 | 657 | | |
658 | | - | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
659 | 666 | | |
660 | 667 | | |
661 | 668 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1477 | 1477 | | |
1478 | 1478 | | |
1479 | 1479 | | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
1480 | 1483 | | |
1481 | 1484 | | |
1482 | 1485 | | |
| |||
2175 | 2178 | | |
2176 | 2179 | | |
2177 | 2180 | | |
2178 | | - | |
2179 | | - | |
| 2181 | + | |
| 2182 | + | |
2180 | 2183 | | |
2181 | 2184 | | |
2182 | 2185 | | |
| |||
0 commit comments