Skip to content

Fix pnet dependency#5

Open
theogilbert wants to merge 2 commits into
kaegi:masterfrom
theogilbert:fix-pnet-dependency
Open

Fix pnet dependency#5
theogilbert wants to merge 2 commits into
kaegi:masterfrom
theogilbert:fix-pnet-dependency

Conversation

@theogilbert

Copy link
Copy Markdown

Building projects using the netinfo dependency currently fails because of the pnet library:

> cargo build
    Updating crates.io index
   Compiling libc v0.2.81
   ...
   Compiling pnet_packet v0.21.0
error[E0599]: no method named `to_primitive_values` found for struct `MacAddr` in the current scope
   --> target/debug/build/pnet_packet-8156a982b0731b69/out/ethernet.rs:442:24
    |
442 |         let vals = val.to_primitive_values();
    |                        ^^^^^^^^^^^^^^^^^^^ method not found in `MacAddr`

error[E0599]: no method named `to_primitive_values` found for struct `MacAddr` in the current scope
   --> target/debug/build/pnet_packet-8156a982b0731b69/out/ethernet.rs:499:24
    |
499 |         let vals = val.to_primitive_values();
    |                        ^^^^^^^^^^^^^^^^^^^ method not found in `MacAddr`

error[E0599]: no method named `to_primitive_values` found for struct `MacAddr` in the current scope
   --> target/debug/build/pnet_packet-8156a982b0731b69/out/arp.rs:776:24
    |
776 |         let vals = val.to_primitive_values();
    |                        ^^^^^^^^^^^^^^^^^^^ method not found in `MacAddr`

error[E0599]: no method named `to_primitive_values` found for struct `MacAddr` in the current scope
   --> target/debug/build/pnet_packet-8156a982b0731b69/out/arp.rs:874:24
    |
874 |         let vals = val.to_primitive_values();
    |                        ^^^^^^^^^^^^^^^^^^^ method not found in `MacAddr`

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0599`.
error: could not compile `pnet_packet`

This behavior can be replicated by adding the dependency netinfo = "0.5.1" in the Cargo.toml file of an empty cargo project, and by building this project:

cargo new test_netinfo
cd test_netinfo
echo 'netinfo = "0.5.1"' >> Cargo.toml
cargo build

It seems to be related to this issue. It looks like the version 0.21.0 of libpnet is broken.

The proposed fix is to update the pnet dependency to the latest version 0.26.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant