[dhcp4relay] Reject chained requests with a local giaddr - #126
Draft
Xichen96 wants to merge 1 commit into
Draft
Conversation
Check nonzero giaddr values against all local IPv4 interface addresses and drop local matches or lookup failures before forwarding. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2b881aa9-3a3a-4aaf-b2ca-b941705b2438 Signed-off-by: Xichen96 <lukelin0907@gmail.com>
Collaborator
|
/azp run |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
21 tasks
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.
Description of PR
Summary:
Reject nonzero-
giaddrchained requests whengiaddrmatches any IPv4 addressowned by the local relay, preventing relay loops and local-address spoofing.
This is a low-priority placeholder for a non-current deployment scenario. This
draft must not merge yet.
Type of change
Approach
What is the motivation for this PR?
RFC 3046 requires rejecting a reforwarded request whose
giaddrspoofs anaddress implemented by the local relay. Native relay currently performs no
local-address check.
How did you do it?
than comparing only one VLAN/source field.
giaddrmatches any local address.address and a nonlocal forwarding case.
How did you verify/test it?
Focused native unit code is included but was NOT RUN, per explicit test
deferral. Test execution is deferred until the higher-priority DHCP relay PRs
listed below merge.
Any platform specific information?
None. This covers a lower-priority, non-current deployment scenario.
Dependencies and future validation TODOs
Validation sequencing depends on these higher-priority relay PRs merging first
(no code dependency; this branch is independently based on fresh
origin/master):Before marking ready or merging:
giaddrdrop across morethan one relay-owned address and nonlocal-
giaddrforwarding:[dhcp_relay] Cover local giaddr loop rejection sonic-mgmt#26325
error path.
Documentation
Behavior follows RFC 3046 local-
giaddrloop/spoof protection.