From d9ce1b7169064ce9f949f28cde60fc2cb4ce400c Mon Sep 17 00:00:00 2001 From: Chris Pick Date: Thu, 22 Feb 2024 19:59:39 -0500 Subject: [PATCH] ebpf: use TC_ACT_PIPE in classifier Demonstrate using the correct constant instead of a magic number. --- {{project-name}}-ebpf/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{project-name}}-ebpf/src/main.rs b/{{project-name}}-ebpf/src/main.rs index 77995c0..9bd7e6b 100644 --- a/{{project-name}}-ebpf/src/main.rs +++ b/{{project-name}}-ebpf/src/main.rs @@ -170,7 +170,7 @@ fn try_{{crate_name}}(ctx: XdpContext) -> Result { Ok(xdp_action::XDP_PASS) } {%- when "classifier" %} -use aya_ebpf::{macros::classifier, programs::TcContext}; +use aya_ebpf::{bindings::TC_ACT_PIPE, macros::classifier, programs::TcContext}; use aya_log_ebpf::info; #[classifier] @@ -183,7 +183,7 @@ pub fn {{crate_name}}(ctx: TcContext) -> i32 { fn try_{{crate_name}}(ctx: TcContext) -> Result { info!(&ctx, "received a packet"); - Ok(0) + Ok(TC_ACT_PIPE) } {%- when "cgroup_skb" %} use aya_ebpf::{