Browse Source

Update README.md

CgroupSkb::attach() requires three parameters
x0rw 1 week ago
parent
commit
34a3d6c27b
1 changed files with 2 additions and 2 deletions
  1. 2 2
      README.md

+ 2 - 2
README.md

@@ -78,7 +78,7 @@ use a `BPF_PROG_TYPE_CGROUP_SKB` program with aya:
 ```rust
 use std::fs::File;
 use aya::Ebpf;
-use aya::programs::{CgroupSkb, CgroupSkbAttachType};
+use aya::programs::{CgroupSkb, CgroupSkbAttachType, CgroupAttachMode};
 
 // load the BPF code
 let mut ebpf = Ebpf::load_file("ebpf.o")?;
@@ -92,7 +92,7 @@ ingress.load()?;
 // attach the program to the root cgroup. `ingress_filter` will be called for all
 // incoming packets.
 let cgroup = File::open("/sys/fs/cgroup/unified")?;
-ingress.attach(cgroup, CgroupSkbAttachType::Ingress)?;
+ingress.attach(cgroup, CgroupSkbAttachType::Ingress, CgroupAttachMode::AllowOverride)?;
 ```
 
 ## Contributing