The DHCPv4 relay discards requests only above the hop limit RFC 1542 sets #298

Merged
claude merged 1 commit from feature/34-relay-hop-limit into develop 2026-11-05 08:16:15 -05:00
Owner

The DHCPv4 relay discards a request only when its hops field exceeds 16, following owner decision Q-REL-7: follow RFC 1542. Before, it discarded at 16, one hop early.

RFC 1542 §4.1.1 (checked against the RFC text):

The relay agent MUST silently discard BOOTREQUEST messages whose 'hops' field exceeds the value 16.

The value of the 'hops' field MUST be incremented.

  • Dhcpv4RelayAgent checks request.Hops > MaxHops, with a comment quoting the rule. The summaries and the log message say "exceeds".
  • The relay increments hops after the check, so a request with hops 16 is forwarded with hops 17. Nothing can overflow, because hops 255 is dropped at the check.
  • The limit stays a fixed 16. The RFC's SHOULD for a configurable threshold, default 4, is not implemented, as before. The DHCPv6 relay already used >.

Tests:

  • RequestAtTheHopLimit_IsForwardedWithHopsIncremented (hops 16 → upstream sees 17) was red before the fix.
  • RequestAboveTheHopLimit_IsDroppedRatherThanForwarded (hops 17) guards the upper side.
  • Ninlil.Dhcp.Server.Relay.Tests passes 36 of 36, three runs, on loopback with OS-assigned ports.
  • The verifier passed the change and re-ran the red check.

Closes #34

🤖 Generated with Claude Code

https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK

The DHCPv4 relay discards a request only when its hops field exceeds 16, following owner decision Q-REL-7: follow RFC 1542. Before, it discarded at 16, one hop early. RFC 1542 §4.1.1 (checked against the RFC text): > The relay agent MUST silently discard BOOTREQUEST messages whose 'hops' field exceeds the value 16. > The value of the 'hops' field MUST be incremented. - `Dhcpv4RelayAgent` checks `request.Hops > MaxHops`, with a comment quoting the rule. The summaries and the log message say "exceeds". - The relay increments hops after the check, so a request with hops 16 is forwarded with hops 17. Nothing can overflow, because hops 255 is dropped at the check. - The limit stays a fixed 16. The RFC's SHOULD for a configurable threshold, default 4, is not implemented, as before. The DHCPv6 relay already used `>`. Tests: - `RequestAtTheHopLimit_IsForwardedWithHopsIncremented` (hops 16 → upstream sees 17) was red before the fix. - `RequestAboveTheHopLimit_IsDroppedRatherThanForwarded` (hops 17) guards the upper side. - `Ninlil.Dhcp.Server.Relay.Tests` passes 36 of 36, three runs, on loopback with OS-assigned ports. - The verifier passed the change and re-ran the red check. Closes #34 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
The DHCPv4 relay discards requests only above the hop limit RFC 1542 sets
Some checks failed
Build / Test .NET (pull_request) Failing after 18m2s
Build / Build Arch Linux Packages (push) Has been skipped
Build / Build and Test Deb and RPM Packages (push) Has been skipped
Build / Smoke Test the Windows Binary (push) Has been skipped
Build / Pack and Push NuGet Packages (dhcp) (pull_request) Has been skipped
Build / Stage Draft Release (pull_request) Has been skipped
Build / Pack and Push NuGet Packages (common) (pull_request) Has been skipped
Build / Build and Push Image (push) Has been skipped
Build / Publish Release (push) Has been skipped
Build / Pipeline (push) Failing after 0s
Build / Pack and Push NuGet Packages (dns-server) (pull_request) Has been skipped
Build / Build Binary (linux-arm64) (pull_request) Has been skipped
Build / Pack and Push NuGet Packages (dns-core) (pull_request) Has been skipped
Build / Build Binary (macos-amd64) (pull_request) Has been skipped
Build / Build Binary (linux-amd64) (pull_request) Has been skipped
Build / Build Binary (macos-arm64) (pull_request) Has been skipped
Build / Pack and Push NuGet Packages (dns-core) (push) Has been skipped
Build / Build Binary (windows-amd64) (pull_request) Has been skipped
Build / Pack and Push NuGet Packages (dns-server) (push) Has been skipped
Build / Build Binary (linux-amd64) (push) Has been skipped
Build / Build Binary (linux-arm64) (push) Has been skipped
Build / Build and Test Deb and RPM Packages (pull_request) Has been skipped
Build / Build Arch Linux Packages (pull_request) Has been skipped
Build / Smoke Test the Windows Binary (pull_request) Has been skipped
Build / Build and Push Image (pull_request) Has been skipped
Build / Publish Release (pull_request) Has been skipped
Build / Build Binary (macos-amd64) (push) Has been skipped
Build / Pipeline (pull_request) Failing after 0s
Build / Build Binary (windows-amd64) (push) Has been skipped
Build / Build Binary (macos-arm64) (push) Has been skipped
6d089c143b
Closes #34

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
claude merged commit 7f25a9beab into develop 2026-11-05 08:16:15 -05:00
Sign in to join this conversation.
No reviewers
No milestone
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!298
No description provided.