feat(dhcpv4): answer DHCPINFORM regardless of pool coverage (RFC 2131 §4.3.5)#12
Merged
Conversation
… §4.3.5) INFORM was answered only when the client's address fell inside a configured range, so an authoritative server stayed silent for on-link clients outside any pool. RFC 2131 §4.3.5 says the server returns the client's local configuration regardless of pools. Drop the range requirement: an authoritative network now always answers INFORM, using the matching range's options when the address is in one and otherwise class / interface-derived local config. yiaddr stays 0 and no lease time is added (unchanged). Non-authoritative networks still ignore INFORM. Adds message-type unit tests (in-range ACK, out-of-range ACK, non-authoritative ignored) and updates docs/rfc_compliance.md.
The INFORM arm returns early, bypassing the shared-tail DROP-class check, so a client the operator classed DROP (meant to be silenced) would receive an INFORM ACK. Repeat the DROP check inside the INFORM arm before responding. This also fixes the pre-existing in-range INFORM DROP bypass. Adds a test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
DHCPINFORM was answered only when the client's address fell inside a configured range, so an authoritative server stayed silent for on-link clients whose address isn't in any pool (static hosts, out-of-pool addresses). RFC 2131 §4.3.5 says the server responds to INFORM with the client's local configuration regardless of pools.
Change
In
plugins/message-type, drop the range requirement from the INFORM arm. Anauthoritativenetwork now always answers INFORM:collect_opts(&empty, classes)→populate_optsstill fills subnet mask / router / broadcast from the interface and any PRL-requested configured options).Unchanged invariants:
yiaddr = 0, no lease time (opt 51) — the path usespopulate_opts, notpopulate_opts_lease. Theauthoritativegate stays (non-authoritative networks intentionally ignore INFORM for multi-server coexistence).Tests
There were no INFORM tests before. Adds three message-type unit tests:
test_inform_in_range_acks— in-range → ACK, yiaddr 0, no lease timetest_inform_out_of_range_still_acks— on-link but out-of-pool → ACK (the relaxed behavior; previously suppressed)test_inform_non_authoritative_ignored— non-authoritative → NoResponse (gating unchanged)cargo fmt+clippy -D warningsclean.Closes roadmap item #3 in docs/rfc_compliance.md.