|
@@ -43,7 +43,7 @@ impl AsRawFd for BpfDevice {
|
|
|
fn open_device() -> io::Result<libc::c_int> {
|
|
|
unsafe {
|
|
|
for i in 0..256 {
|
|
|
- let dev = format!("/dev/bpf{}", i).as_ptr() as *const libc::c_char;
|
|
|
+ let dev = format!("/dev/bpf{}\0", i).as_ptr() as *const libc::c_char;
|
|
|
match libc::open(dev, libc::O_RDWR) {
|
|
|
-1 => continue,
|
|
|
fd => return Ok(fd),
|