diff --git a/Cargo.lock b/Cargo.lock index 60afb00..eb815dd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -97,12 +97,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" -[[package]] -name = "bitflags" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" - [[package]] name = "bitflags" version = "1.3.2" @@ -413,9 +407,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.139" +version = "0.2.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" +checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" [[package]] name = "libloading" @@ -455,7 +449,6 @@ dependencies = [ "itertools", "lazy_static", "log", - "netdevice", "pcap", "pcap-file", "pnet", @@ -481,16 +474,6 @@ dependencies = [ "adler", ] -[[package]] -name = "netdevice" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38e2f7ba898cd2fef0e36f91c9cd2bf3b849a2a31510d5f7e1cf515cbf698198" -dependencies = [ - "bitflags 0.7.0", - "libc", -] - [[package]] name = "no-std-net" version = "0.6.0" diff --git a/Cargo.toml b/Cargo.toml index 0f7cb31..0381c2b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,7 +30,6 @@ flate2 = "1.0" itertools = "0.11.0" lazy_static = "1.4.0" log = "0.4.20" -netdevice = "0.1.1" pcap = "1.1.0" pcap-file = "2.0.0" pnet = { version = "0.33.0", features = ["std"] } diff --git a/src/masscanned.rs b/src/masscanned.rs index ea442ce..5198dec 100644 --- a/src/masscanned.rs +++ b/src/masscanned.rs @@ -196,7 +196,7 @@ fn main() { ); return; }; - if iface.flags & (netdevice::IFF_UP.bits() as u32) == 0 { + if !iface.is_up() { error!("specified interface is DOWN"); return; } @@ -286,7 +286,7 @@ fn main() { let (mut tx, mut rx) = get_channel(masscanned.iface.unwrap()); loop { /* check if network interface is still up */ - if masscanned.iface.unwrap().flags & (netdevice::IFF_UP.bits() as u32) == 0 { + if !masscanned.iface.unwrap().is_up() { error!("interface is DOWN - aborting"); break; }