From b263338358b8bd99505cbf16878d4f022dce36e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=84=91=E8=A2=8B=E9=87=8C=E8=BF=9B=E8=8A=B1=E7=94=9F?= =?UTF-8?q?=E4=BA=86?= <109732988+Redmomn@users.noreply.github.com> Date: Sat, 6 Sep 2025 20:38:15 +0800 Subject: [PATCH] fix: use the correct return value for cgroup_skb `cgroup_skb` returns 0 will block traffic in the current direction. An example program should not block traffic, this can cause difficulties for beginners. --- {{project-name}}-ebpf/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{project-name}}-ebpf/src/main.rs b/{{project-name}}-ebpf/src/main.rs index 18233ae..7a780d4 100644 --- a/{{project-name}}-ebpf/src/main.rs +++ b/{{project-name}}-ebpf/src/main.rs @@ -183,7 +183,7 @@ pub fn {{crate_name}}(ctx: SkBuffContext) -> i32 { fn try_{{crate_name}}(ctx: SkBuffContext) -> Result { info!(&ctx, "received a packet"); - Ok(0) + Ok(1) } {%- when "tracepoint" %} use aya_ebpf::{macros::tracepoint, programs::TracePointContext};