-
Notifications
You must be signed in to change notification settings - Fork 3.2k
ipsec: Simplify XFRM FWD policies #21602
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
sayboras
merged 3 commits into
cilium:master
from
pchaigno:ipsec-simplify-xfrm-fwd-policies
Oct 10, 2022
Merged
ipsec: Simplify XFRM FWD policies #21602
sayboras
merged 3 commits into
cilium:master
from
pchaigno:ipsec-simplify-xfrm-fwd-policies
Oct 10, 2022
+29
−29
Conversation
This file contains 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
christarazi
approved these changes
Oct 7, 2022
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.
Nice cleanup.
jrfastab
approved these changes
Oct 10, 2022
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.
Thanks!
We want the FWD XFRM policy to allow all traffic through so we can simply set its source CIDR to 0.0.0.0/0. Similarly, the source IP used in the template doesn't matter so we can set it to 0.0.0.0 to clarify that to the kernel. Signed-off-by: Paul Chaignon <[email protected]>
We currently install two FWD XFRM policies: one as part of UpsertIPsecEndpoint when called for the In direction and another one as part of enableIPsec, even though that function already calls UpsertIPsecEndpoint. Only one FWD XFRM policy is needed to match all forward traffic. This commit removes one of the policies. Signed-off-by: Paul Chaignon <[email protected]>
The `fwd` argument of the UpsertIPsecEndpoitn function is used as the matching CIDR for the destination in the FWD XFRM policy. That CIDR should always be equal to the local CIDR and we already have that as the first argument of UpsertIPsecEndpoint. Therefore, we don't need the third, `fwd`, argument. This commit removes it. Signed-off-by: Paul Chaignon <[email protected]>
96d788e
to
2650e0a
Compare
/test |
All required tests are passed, mark ready to merge. |
This was referenced Oct 10, 2022
This was referenced Oct 11, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/encryption
Impacts encryption support such as IPSec, WireGuard, or kTLS.
backport-done/1.11
The backport for Cilium 1.11.x for this PR is done.
backport-done/1.12
The backport for Cilium 1.12.x for this PR is done.
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 pull request implements various simplifications of our XFRM FWD policies and the code that installs them. See commits for details.