-
Notifications
You must be signed in to change notification settings - Fork 0
crap: introduce cilium raw acquisition of packets #3
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
base: vtep_policy
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ | ||
| /* Copyright Authors of Cilium */ | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <linux/bpf.h> | ||
| #include <bpf/section.h> | ||
| #include <bpf/loader.h> | ||
| #include <lib/static_data.h> | ||
|
|
||
| struct crap_key { | ||
| __u32 dst_ip; | ||
| }; | ||
|
|
||
| struct crap_value { | ||
| __u32 pod_ip; | ||
| }; | ||
|
|
||
| struct { | ||
| __uint(type, BPF_MAP_TYPE_HASH); | ||
| __type(key, struct crap_key); | ||
| __type(value, struct crap_value); | ||
| __uint(pinning, LIBBPF_PIN_BY_NAME); | ||
| __uint(max_entries, 8192); | ||
| __uint(map_flags, BPF_F_NO_PREALLOC); | ||
| } cilium_crap_map __section_maps_btf; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| // Copyright Authors of Cilium | ||
|
|
||
| package cmd | ||
|
|
||
| import ( | ||
| "github.com/spf13/cobra" | ||
| ) | ||
|
|
||
| // BPFCrapCmd represents the bpf command | ||
| var BPFCrapCmd = &cobra.Command{ | ||
| Use: "crap", | ||
| Short: "Manage the CRAP rules", | ||
| } | ||
|
|
||
| func init() { | ||
| BPFCmd.AddCommand(BPFCrapCmd) | ||
| } |
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.
Missing remote endpoint fallback in overlay CRAP handling
Medium Severity
In
bpf_host.c, when a CRAP entry exists but the local endpoint lookup fails, the code falls back tolookup_ip4_remote_endpointand usesencap_and_redirect_with_nodeidto forward traffic to the correct node. However,bpf_overlay.clacks this fallback—if the CRAP entry exists but the pod isn't local, traffic silently falls through to normal processing. This inconsistency means CRAP won't work correctly for overlay traffic when the target pod is on a different node.Additional Locations (1)
bpf/bpf_host.c#L726-L732