libbpf / libbpf-rs

Minimal and opinionated eBPF tooling for the Rust ecosystem
Other
788 stars 138 forks source link

Make various Program::attach_* methods work on shared receiver #955

Closed d-e-s-o closed 1 month ago

d-e-s-o commented 1 month ago

Attaching a BPF program currently provides exclusive access to the Program object, but it's not exactly clear why that is. Given that libbpf work on const pointers, let's switch over to having those methods work on a shared receiver instead, eliminating a bunch of possible borrow conflicts.

Refs: #953