Merge pull request #263 from nak3/cgroup-skb-attach-type

Set attach type during load for BPF_PROG_TYPE_CGROUP_SKB
pull/269/head
Alessandro Decina 3 years ago committed by GitHub
commit 63b6286bd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -62,6 +62,12 @@ pub struct CgroupSkb {
impl CgroupSkb {
/// Loads the program inside the kernel.
pub fn load(&mut self) -> Result<(), ProgramError> {
self.data.expected_attach_type =
self.expected_attach_type
.map(|attach_type| match attach_type {
CgroupSkbAttachType::Ingress => BPF_CGROUP_INET_INGRESS,
CgroupSkbAttachType::Egress => BPF_CGROUP_INET_EGRESS,
});
load_program(BPF_PROG_TYPE_CGROUP_SKB, &mut self.data)
}

Loading…
Cancel
Save