[v1.19] l7lb: fix bypassing ingress policies for local backends#44800
Merged
julianwiedmann merged 3 commits intov1.19from Mar 16, 2026
Merged
[v1.19] l7lb: fix bypassing ingress policies for local backends#44800julianwiedmann merged 3 commits intov1.19from
julianwiedmann merged 3 commits intov1.19from
Conversation
[ upstream commit 42ecbb1 ] This is to clarify the naming and distinguish with the new tests we are going to introduce in subsequent commits. Signed-off-by: Simone Magnani <simone.magnani@isovalent.com>
[ upstream commit ffdede7 ] [ backporter's notes: changed node_config.h to support definition of CILIUM_NET_IFINDEX and CILIUM_HOST_IFINDEX macros, which are needed in the backported test. Unfortunately, CONFIG(cilium_host_ifindex) has not been backported, and re-defining the macro is not possible, so I hacked it ] This commits adds IPv4/IPv6 tests for the case in which L7LB is enabled and opens a connection on behalf of a pod destined to a local backend. In case per-endpoint routes are not enabled, the packet will be handled in the cil_from_host program, will tail call to the egress policy program, and then return to stack. Signed-off-by: Simone Magnani <simone.magnani@isovalent.com>
[ upstream commit ea17ed8 ] [ backporter's notes: using macro CILIUM_HOST_IFINDEX instead of CONFIG(cilium_host_ifindex) as it was not backported. ] In commit d1d8e7a ("datapath: Add support for re-entering LXC egress path after L7 LB"), we enabled support for re-entering the LXC egress path after a packet is processed by a L7 LB. This allows us to correctly apply egress policies to packets sent by a L7 LB to local backends. Without per-endpoint routes, the pod policies are checked from the tail call in bpf_host. We reach this code from cilium_host (ctx->ifindex). With per-endpoint routes, the packet is handled directly in the local backend pod `cil_to_container` path, completely skipping ingress policies. Returning CTX_ACT_OK at this point would bypass policies. To fix this, we need to hairpin the packet back to cil_to_container (the ctx->mark is already cleared at the beginning of the codepath). This would allow us to correctly apply ingress policies on the local backend ingress path, restoring the expected behavior. Fixes: d1d8e7a ("datapath: Add support for re-entering LXC egress path after L7 LB") Signed-off-by: Simone Magnani <simone.magnani@isovalent.com>
Contributor
Author
|
/test |
julianwiedmann
approved these changes
Mar 16, 2026
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.
Once this PR is merged, a GitHub action will update the labels of these PRs: