Update README.md

CgroupSkb::attach() requires three parameters
reviewable/pr1224/r1
x0rw 3 weeks ago committed by Tamir Duberstein
parent 29f4f2b780
commit 34a3d6c27b

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

Loading…
Cancel
Save