Skip to content

Commit 34a3d6c

Browse files
x0rwtamird
authored andcommitted
Update README.md
CgroupSkb::attach() requires three parameters
1 parent 29f4f2b commit 34a3d6c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ use a `BPF_PROG_TYPE_CGROUP_SKB` program with aya:
7878
```rust
7979
use std::fs::File;
8080
use aya::Ebpf;
81-
use aya::programs::{CgroupSkb, CgroupSkbAttachType};
81+
use aya::programs::{CgroupSkb, CgroupSkbAttachType, CgroupAttachMode};
8282

8383
// load the BPF code
8484
let mut ebpf = Ebpf::load_file("ebpf.o")?;
@@ -92,7 +92,7 @@ ingress.load()?;
9292
// attach the program to the root cgroup. `ingress_filter` will be called for all
9393
// incoming packets.
9494
let cgroup = File::open("/sys/fs/cgroup/unified")?;
95-
ingress.attach(cgroup, CgroupSkbAttachType::Ingress)?;
95+
ingress.attach(cgroup, CgroupSkbAttachType::Ingress, CgroupAttachMode::AllowOverride)?;
9696
```
9797

9898
## Contributing

0 commit comments

Comments
 (0)