The DHCPv4 server checks that an address is unused before it offers it #169

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

Why

RFC 2131 §2.2 and §4.4.1 say a server SHOULD probe an address (for example with ICMP echo) before allocating it. Ninlil never probes.

What changes

  • New IDhcpAddressConflictProbe in src/dotnet/src/Ninlil.Dhcp.Server.Core/Allocation/, with a System.Net.NetworkInformation.Ping implementation. .NET on Linux tries a raw socket, then an unprivileged ICMP socket, then the ping tool; document what the systemd unit allows.
  • In ResolveCandidateAddressAsync, probe only fresh candidates (not reservations, sticky addresses or renewals). On a reply, quarantine the address with the existing decline path (QuarantineRow, line 555, DhcpServerOptions.DeclinedAddressQuarantineDuration) and try the next candidate. Cap the probes per DISCOVER (for example 3).
  • src/dotnet/src/Ninlil.Dhcp.Server.Core/DhcpServerOptions.cs: add EnableAddressConflictDetection (default true) and AddressConflictProbeTimeout (default 500 ms). Update ENVIRONMENT.md.

Acceptance

  • This test fails first: with a fake probe that answers for the first free address, Allocate_WhenTheFirstCandidateAnswersAPing_OffersTheNextAndQuarantinesTheFirst.
  • Tests: probe cap; probing off; a reservation is never probed; the defaults are true and 500 ms.
  • ENVIRONMENT.md and README.md updated.
  • Gate: dotnet test src/dotnet/tests/Ninlil.Dhcp.Server.Core.Tests.

Source

audit-feature-parity.md §2A #14; RFC 2131 §2.2, §4.4.1.
Owner decision 2026-10-31: "ping check: on, 500 ms" (Q-PN-9).

- **Draft:** PN-25 - **Priority:** medium - **Agent:** protocol-coder - **Depends on:** none - **Decisions:** Q-PN-9 ### Why RFC 2131 §2.2 and §4.4.1 say a server SHOULD probe an address (for example with ICMP echo) before allocating it. Ninlil never probes. ### What changes - New `IDhcpAddressConflictProbe` in `src/dotnet/src/Ninlil.Dhcp.Server.Core/Allocation/`, with a `System.Net.NetworkInformation.Ping` implementation. .NET on Linux tries a raw socket, then an unprivileged ICMP socket, then the `ping` tool; document what the systemd unit allows. - In `ResolveCandidateAddressAsync`, probe only fresh candidates (not reservations, sticky addresses or renewals). On a reply, quarantine the address with the existing decline path (`QuarantineRow`, line 555, `DhcpServerOptions.DeclinedAddressQuarantineDuration`) and try the next candidate. Cap the probes per DISCOVER (for example 3). - `src/dotnet/src/Ninlil.Dhcp.Server.Core/DhcpServerOptions.cs`: add `EnableAddressConflictDetection` (default `true`) and `AddressConflictProbeTimeout` (default 500 ms). Update ENVIRONMENT.md. ### Acceptance - [ ] This test fails first: with a fake probe that answers for the first free address, `Allocate_WhenTheFirstCandidateAnswersAPing_OffersTheNextAndQuarantinesTheFirst`. - [ ] Tests: probe cap; probing off; a reservation is never probed; the defaults are `true` and 500 ms. - [ ] ENVIRONMENT.md and README.md updated. - [ ] Gate: `dotnet test src/dotnet/tests/Ninlil.Dhcp.Server.Core.Tests`. ### Source `audit-feature-parity.md` §2A #14; RFC 2131 §2.2, §4.4.1. Owner decision 2026-10-31: "ping check: on, 500 ms" (Q-PN-9).
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.

Dependencies

No dependencies set

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