Add `attach` attribute for cgroup SKB

When cgroup SKB is generated via template, the `attach` attribute is
always missing and the program does not work by default.

This patch fixes it.
pull/32/head
Kenjiro Nakayama 3 years ago
parent c41fb5ef0d
commit 6fcf0c5669

@ -183,7 +183,11 @@ use aya_bpf::{
programs::SkBuffContext, programs::SkBuffContext,
}; };
#[cgroup_skb(name="{{crate_name}}")] {% if direction == "Ingress" -%}
#[cgroup_skb(name="{{crate_name}}",attach="ingress")]
{%- else -%}
#[cgroup_skb(name="{{crate_name}}",attach="egress")]
{%- endif %}
pub fn {{crate_name}}(ctx: SkBuffContext) -> i32 { pub fn {{crate_name}}(ctx: SkBuffContext) -> i32 {
match unsafe { try_{{crate_name}}(ctx) } { match unsafe { try_{{crate_name}}(ctx) } {
Ok(ret) => ret, Ok(ret) => ret,

Loading…
Cancel
Save