Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add illumos support #549

Merged
merged 3 commits into from Apr 25, 2022
Merged

Add illumos support #549

merged 3 commits into from Apr 25, 2022

Commits on Apr 11, 2022

  1. Add illumos+solaris support

    teutat3s committed Apr 11, 2022
    Copy the full SHA
    f7aa541 View commit details
    Browse the repository at this point in the history
  2. Fix error[E0308]: mismatched types on illumos +

    solaris
    
    error[E0308]: mismatched types
       --> pnet_datalink/src/lib.rs:239:22
        |
    239 |         self.flags & (pnet_sys::IFF_UP as u32) != 0
        |                      ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u64`, found `u32`
    
    error[E0277]: no implementation for `u64 & u32`
       --> pnet_datalink/src/lib.rs:239:20
        |
    239 |         self.flags & (pnet_sys::IFF_UP as u32) != 0
        |                    ^ no implementation for `u64 & u32`
        |
        = help: the trait `BitAnd<u32>` is not implemented for `u64`
    ...
    teutat3s committed Apr 11, 2022
    Copy the full SHA
    854efcd View commit details
    Browse the repository at this point in the history
  3. Fix build lifetime issue on freebsd, netbsd,

    illumos and solaris, too
    
    warning: getting the inner pointer of a temporary `CString`
      --> src/bpf.rs:82:57
       |
    82 |                 CString::new(&b"/dev/bpf"[..]).unwrap().as_ptr(),
       |                 --------------------------------------- ^^^^^^ this pointer will be invalid
       |                 |
       |                 this `CString` is deallocated at the end of the statement, bind it to a variable to extend its lifetime
       |
       = note: `#[warn(temporary_cstring_as_ptr)]` on by default
       = note: pointers do not have a lifetime; when calling `as_ptr` the `CString` will be deallocated at the end of the statement because nothing is referencing it as far as the type system is concerned
       = help: for more information, see https://doc.rust-lang.org/reference/destructors.html
    teutat3s committed Apr 11, 2022
    Copy the full SHA
    e175359 View commit details
    Browse the repository at this point in the history