szymonwieloch / rust-rawsock

Rust library for obtaining and sending raw network packets from interfaces.
MIT License
64 stars 16 forks source link

Panic when sending packet quickly #11

Open lihe07 opened 2 years ago

lihe07 commented 2 years ago

I'm using wpcap as backend. My program uses multithreading to send packets, but it panics when the rate is fast.

thread '<unnamed>' panicked at 'assertion failed: `(left == right)`
  left: `-1`,
 right: `0`', .....\rawsock-0.3.0\src\wpcap\interface.rs:85:13

Maybe instead of panic here, return a Result::Err(). This is helpful for error handling