DouglasGray / xsk-rs

A Rust interface for Linux AF_XDP sockets
MIT License
68 stars 16 forks source link

Fail to run hello_xdp #24

Closed ZENOTME closed 6 months ago

ZENOTME commented 8 months ago

Hi, I failed to run hello_xdp in the master branch. I'm not sure whether there is a problem with my env set or I forgot to install something.

system version:

❯ uname -a
Linux zenotme-ubuntu 6.5.0-21-generic #21~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Feb  9 13:32:52 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

error msg:

❯ sudo ./target/release/examples/hello_xdp
sending: "Hello, world!"
thread 'tokio-runtime-worker' panicked at examples/hello_xdp.rs:82:5:
no matching packets received
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failed to delete link: NetlinkError(ErrorMessage { code: -95, header: [32, 0, 0, 0, 17, 0, 5, 6, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] }) (you may need to delete it manually with 'sudo ip link del xsk_test_dev1')
thread 'main' panicked at examples/hello_xdp.rs:127:36:
called `Result::unwrap()` on an `Err` value: task 30 panicked
ZENOTME commented 8 months ago

I guess it's caused by the version. I switch to feat/use-libxdp-sys and it works.🥵

DouglasGray commented 8 months ago

I believe this was an issue with the previous code using b'hello' instead of a correctly structured ethernet packet. it's fixed in the branch you mention

DouglasGray commented 6 months ago

closing this since feat/use-libxdp-sys is now merged