Fix --exclude-local-address with eBPF Host-Routing#41275
Fix --exclude-local-address with eBPF Host-Routing#41275pchaigno merged 1 commit intocilium:mainfrom
Conversation
7a058c4 to
2c0afdf
Compare
|
/test |
|
/test |
@antonipp It's strange that you couldn't trigger tests. Have you had this issue before? |
jrife
left a comment
There was a problem hiding this comment.
Should something similar be done in handle_ipv6_from_lxc? Also just a heads up, you might want to rebase and test with #37725 which just got merged. AFAIK it shouldn't impact anything, but slightly changes how the fib lookup happens with the addition of the BPF_FIB_LOOKUP_SKIP_NEIGH flag.
2c0afdf to
74637cf
Compare
|
Thanks for the reviews, addressed the comments 👍
Yep, I did notice that this was quite flaky recently. For example in this PR, I was not able to run them consistently: #41154 I also noticed that the current PR has more failed E2E tests than usual 🤔 https://github.com/cilium/cilium/actions/runs/17077534336/job/48422818273 And this BPF complexity verifier failure looks legit as well: https://github.com/cilium/cilium/actions/runs/17077535162/job/48422742276 (need to look further into it) |
|
/test |
|
/test
Ouch, that's going to be tricky to work around. I'm guessing we're probably already quite "close" to the complexity limit and, since your change is adding new branches, it's enough to push complexity over the limit.
Probably related to the complexity issue, no? |
|
My bad, it's not a complexity issue but a good old verifier reject: Are we sure |
74637cf to
e25cfd4
Compare
|
/ci-verifier |
e25cfd4 to
4976737
Compare
|
/ci-verifier |
b2fa68b to
f9b5a55
Compare
|
/ci-verifier |
|
/test |
f9b5a55 to
e5d4267
Compare
|
/test |
This change adds error-handling logic that fixes routing for local addresses which have been passed in --exclude-local-address. Previously, the routing code would always attempt a FIB lookup for packets destined to these addresses which would always fail with BPF_FIB_LKUP_RET_NOT_FWDED because the addresses are local. The routing code will now remediate this by passing the packet to the kernel's routing stack when encountering this scenario. The additional revalidate_data check on the ipv4 pointer is needed because it can get invalidated in fib_redirect_v4 so it should be checked before being passed further Signed-off-by: Anton Ippolitov <anton.ippolitov@datadoghq.com>
e5d4267 to
367db3e
Compare
|
/test |
I'll retrigger these. |
|
/ci-ipsec-e2e |
|
/ci-eks |
|
/ci-clustermesh |
Description
The problem is described in detail in the original issue #41241
This PR adds error-handling logic that fixes routing for local addresses which have been passed in
--exclude-local-address. The routing code will always attempt a FIB lookup for packets destined to these addresses and it will always fail withBPF_FIB_LKUP_RET_NOT_FWDEDbecause the addresses are local. The routing code will now remediate this by passing the packet to the kernel's routing stack when encountering this scenario.Another idea I originally had was to keep track of excluded local addresses in a separate map ( DataDog@844f1c8 ) but this obviously introduces more complexity that the current PR.
Testing
Setup: deploy a pod with NLD bound to
169.254.20.10. Set--exclude-local-address="169.254.20.10/31"and enable eBPF Host-Routing on the Cilium Agent.Before the PR:
After the PR:
Fixes: #41241