aya-rs / book

The Aya Book is an introductory book about using the Rust Programming Language and Aya library to build extended Berkley Packet Filter (eBPF) programs.
https://aya-rs.dev/book/
Apache License 2.0
79 stars 60 forks source link

Invalid argument (os error 22) on attach, classifier program #143

Closed emanuele-em closed 10 months ago

emanuele-em commented 10 months ago

On this line

    program.attach(&opt.iface, TcAttachType::Egress)?; //&opt.iface = wlo1

the program always return:

Error: netlink error while attaching ebpf program to tc Caused by: Invalid argument (os error 22)

I'm using Arch linux with kernel version 6.6.6-arch1-1 Rust version is 1.75 stable

p.s. other programs like XDP correctly compile and run

alessandrod commented 10 months ago

Can you run your program under strace -e trace=network -s10000000 and attach the output?

emanuele-em commented 10 months ago

Sorry for this issue, now it works correctly, something went wrong with the cache.