mirror of
https://github.com/aya-rs/aya.git
synced 2025-12-12 20:35:55 +01:00
Update README.md
CgroupSkb::attach() requires three parameters
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user