Skip to content

Fix the pnet_sys crate

error[E0432]: unresolved imports `libc::IFF_BROADCAST`, `libc::IFF_LOOPBACK`, `libc::IFF_RUNNING`, `libc::IFF_MULTICAST`, `libc::IFF_POINTOPOINT`, `libc::IFF_UP`
  --> /home/ribbon/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pnet_sys-0.34.0/src/unix.rs:53:20
   |
53 | ...::{IFF_BROADCAST, IFF_LOOPBACK, IFF_RUNNING, IFF_MULTICAST, IFF_POINTOPOINT, IFF_U...
   |       ^^^^^^^^^^^^^  ^^^^^^^^^^^^  ^^^^^^^^^^^  ^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^  ^^^^^^ no `IFF_UP` in the root
   |       |              |             |            |              |
   |       |              |             |            |              no `IFF_POINTOPOINT` in the root
   |       |              |             |            no `IFF_MULTICAST` in the root
   |       |              |             no `IFF_RUNNING` in the root
   |       |              no `IFF_LOOPBACK` in the root
   |       no `IFF_BROADCAST` in the root
   |       help: a similar name exists in the module: `SO_BROADCAST`

   Compiling csv-core v0.1.11
error[E0425]: cannot find value `SOCK_RAW` in crate `libc`
  --> /home/ribbon/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pnet_sys-0.34.0/src/unix.rs:40:45
   |
40 |     pub const SOCK_RAW: libc::c_int = libc::SOCK_RAW;
   |                                             ^^^^^^^^ not found in `libc`
   |
help: consider importing this constant through its public re-export
   |
6  +     use crate::SOCK_RAW;
   |
help: if you import `SOCK_RAW`, refer to it directly
   |
40 -     pub const SOCK_RAW: libc::c_int = libc::SOCK_RAW;
40 +     pub const SOCK_RAW: libc::c_int = SOCK_RAW;
   |

error[E0425]: cannot find value `IP_HDRINCL` in crate `libc`
  --> /home/ribbon/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pnet_sys-0.34.0/src/unix.rs:47:47
   |
47 |     pub const IP_HDRINCL: libc::c_int = libc::IP_HDRINCL;
   |                                               ^^^^^^^^^^ not found in `libc`
   |
help: consider importing this constant through its public re-export
   |
6  +     use crate::IP_HDRINCL;
   |
help: if you import `IP_HDRINCL`, refer to it directly
   |
47 -     pub const IP_HDRINCL: libc::c_int = libc::IP_HDRINCL;
47 +     pub const IP_HDRINCL: libc::c_int = IP_HDRINCL;
   |

error[E0308]: mismatched types
  --> /home/ribbon/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pnet_sys-0.34.0/src/unix.rs:97:22
   |
97 |             tv_usec: dur.subsec_micros() as TvUsecType,
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `i64`

Some errors have detailed explanations: E0308, E0425, E0432.