Excluded addresses are never offered, and scope validation and statistics account for them #167

Open
opened 2026-10-31 12:42:19 -04:00 by claude · 0 comments
Owner
  • Draft: PN-23
  • Priority: medium
  • Agent: coder
  • Depends on: #166
  • Decisions: none

Why

An exclusion range is useless until allocation, validation and the pool figures honour it.

What changes

  • Dhcpv4LeaseAllocationService.ResolveCandidateAddressAsync (line 451, loop at 527-543): skip excluded addresses. Apply the same in Dhcpv6LeaseAllocationService for address scopes.
    • Technical call: a reservation inside an exclusion is still served, because a reservation is explicit operator intent. Sticky addresses (ResolveStickyAddressAsync, line 421) inside a new exclusion are not renewed past their lease.
  • src/dotnet/src/Ninlil.Web/Controllers/DhcpScopesController.cs validates ranges (parse, same family, inside the scope range, start ≤ end).
  • src/dotnet/src/Ninlil.Dhcp.Server.Core/Statistics/DhcpScopeStatisticsService.cs subtracts excluded addresses from the pool size. The dashboard's pool-utilisation chart (#118, #124) reads this same service, so it shows excluded addresses as not free with no further change.
  • Models and examples.

Acceptance

  • This test fails first: in src/dotnet/tests/Ninlil.Dhcp.Server.Core.Tests, Allocate_WithTheFirstAddressesExcluded_OffersTheFirstNonExcludedAddress.
  • Tests for v6, statistics, and a 400 for an exclusion outside the range.
  • REST API changed: snapshot regenerated in #171.
  • Gate: dotnet test src/dotnet/tests/Ninlil.Dhcp.Server.Core.Tests, dotnet test src/dotnet/tests/Ninlil.Web.Tests.

Source

audit-feature-parity.md §2A #14; DEDUPE.md A4.

- **Draft:** PN-23 - **Priority:** medium - **Agent:** coder - **Depends on:** #166 - **Decisions:** none ### Why An exclusion range is useless until allocation, validation and the pool figures honour it. ### What changes - `Dhcpv4LeaseAllocationService.ResolveCandidateAddressAsync` (line 451, loop at 527-543): skip excluded addresses. Apply the same in `Dhcpv6LeaseAllocationService` for address scopes. - Technical call: a reservation inside an exclusion is still served, because a reservation is explicit operator intent. Sticky addresses (`ResolveStickyAddressAsync`, line 421) inside a new exclusion are not renewed past their lease. - `src/dotnet/src/Ninlil.Web/Controllers/DhcpScopesController.cs` validates ranges (parse, same family, inside the scope range, start ≤ end). - `src/dotnet/src/Ninlil.Dhcp.Server.Core/Statistics/DhcpScopeStatisticsService.cs` subtracts excluded addresses from the pool size. The dashboard's pool-utilisation chart (#118, #124) reads this same service, so it shows excluded addresses as not free with no further change. - Models and examples. ### Acceptance - [ ] This test fails first: in `src/dotnet/tests/Ninlil.Dhcp.Server.Core.Tests`, `Allocate_WithTheFirstAddressesExcluded_OffersTheFirstNonExcludedAddress`. - [ ] Tests for v6, statistics, and a 400 for an exclusion outside the range. - [ ] REST API changed: snapshot regenerated in #171. - [ ] Gate: `dotnet test src/dotnet/tests/Ninlil.Dhcp.Server.Core.Tests`, `dotnet test src/dotnet/tests/Ninlil.Web.Tests`. ### Source `audit-feature-parity.md` §2A #14; DEDUPE.md A4.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
lantea-one/ninlil#167
No description provided.