diff --git a/aya/src/programs/cgroup_skb.rs b/aya/src/programs/cgroup_skb.rs index ab928a4db..fdde66740 100644 --- a/aya/src/programs/cgroup_skb.rs +++ b/aya/src/programs/cgroup_skb.rs @@ -62,6 +62,11 @@ pub struct CgroupSkb { impl CgroupSkb { /// Loads the program inside the kernel. pub fn load(&mut self) -> Result<(), ProgramError> { + self.data.expected_attach_type = match self.expected_attach_type { + Some(CgroupSkbAttachType::Ingress) => Some(BPF_CGROUP_INET_INGRESS), + Some(CgroupSkbAttachType::Egress) => Some(BPF_CGROUP_INET_EGRESS), + None => None, + }; load_program(BPF_PROG_TYPE_CGROUP_SKB, &mut self.data) }