protectwise / pcap-async

Pure rust wrapper around pcap-sys

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Building for ARM fails

dbrgn opened this issue · comments

When trying to build this crate for the ARM target arm-unknown-linux-gnueabihf (e.g. Raspberry Pi), compilation fails:

error[E0308]: mismatched types
  --> src/handle.rs:30:69
   |
30 |         let h = unsafe { pcap_sys::pcap_create(device_str.as_ptr(), errbuf) };
   |                                                                     ^^^^^^ expected `u8`, found `i8`
   |
   = note: expected raw pointer `*mut u8`
              found raw pointer `*mut i8`

error[E0308]: mismatched types
  --> src/handle.rs:32:39
   |
32 |             pcap_util::cstr_to_string(errbuf).and_then(|msg| {
   |                                       ^^^^^^ expected `u8`, found `i8`
   |
   = note: expected raw pointer `*mut u8`
              found raw pointer `*mut i8`

...

Any ideas? pcap-sys itself builds fine.

Differences in the header for libpcap. Will put an anonymous cast in there, and it might fix it. If I put a change in master can you test it?

Sure!

Can you try the branch in #22?