-
Notifications
You must be signed in to change notification settings - Fork 3.4k
wireguard add check on ipv6_hdrlen for failures #35345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
9eb4bf5
to
9fba8ae
Compare
/test |
9fba8ae
to
0b55d00
Compare
/test |
db9d11c
to
2a01586
Compare
/test |
/ci-eks |
This commit adjusts the name of a variable in the `do_netdev` function. Instead of directly naming `l4_off`, let's opt for `hdrlen` so that, when adding check in the following commit, it is more clear what are we testing. Adjusting values passed to the `ctx_is_wireguard` accordingly with ETH_HLEN. Signed-off-by: Simone Magnani <simone.magnani@isovalent.com>
This commit introduces a check to the output of `ipv6_hdrlen` before calling the ctx_is_wireguard` function for setting the tracing encryption bit to WireGuard packets. In case of no errors, execute `ctx_is_wireguard` and set the encryption bit in case of WireGuard packets. Otherwise, continue without trying to set the encryption bit to the trace event. We do not directly drop the packet here since tracing does not necessarily rely on `ipv6_hdrlen`. The subsequent tail call (`handle_ipv6`) will handle such error case. Offending commit hash: a732cd7 Offending PR: cilium#35183 Signed-off-by: Simone Magnani <simone.magnani@isovalent.com>
2a01586
to
c31da0a
Compare
/test |
julianwiedmann
approved these changes
Oct 23, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thank you!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/datapath
Impacts bpf/ or low-level forwarding details, including map management and monitor messages.
feature/wireguard
Relates to Cilium's Wireguard feature
ready-to-merge
This PR has passed all tests and received consensus from code owners to merge.
release-note/misc
This PR makes changes that have no direct user impact.
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.
This PR adds additional checks after the
ipv6_hdrlen
function call to make sure it didn't fail before continuing processing the packet withctx_is_wireguard
. In case of failure, stop trying to mark it as encrypted, but do not drop the packet. In case we need to drop it, it'll be in the following tailcallhandle_ipv6
, whose processing logic actually relies on that value.Offending commit hash: a732cd7
Offending PR: #35183