|
@@ -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
|