Skip to content

Commit

Permalink
aya-bpf-macros: fix cgroup/skb section name
Browse files Browse the repository at this point in the history
When no expected attach type is passed, the section name must be
cgroup/skb not cgroup_skb.

Fixes aya-rs#896
  • Loading branch information
alessandrod committed Mar 4, 2024
1 parent b6a84b6 commit 84ed505
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions aya-bpf-macros/src/cgroup_skb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl CgroupSkb {
let section_name: Cow<'_, _> = if self.attach_type.is_some() {
format!("cgroup_skb/{}", self.attach_type.as_ref().unwrap()).into()
} else {
"cgroup_skb".into()
"cgroup/skb".into()
};
let fn_vis = &self.item.vis;
let fn_name = self.item.sig.ident.clone();
Expand Down Expand Up @@ -66,7 +66,7 @@ mod tests {
let expanded = prog.expand().unwrap();
let expected = quote! {
#[no_mangle]
#[link_section = "cgroup_skb"]
#[link_section = "cgroup/skb"]
fn foo(ctx: *mut ::aya_bpf::bindings::__sk_buff) -> i32 {
return foo(::aya_bpf::programs::SkBuffContext::new(ctx));

Expand Down

0 comments on commit 84ed505

Please sign in to comment.