We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0e70983 commit 345c78dCopy full SHA for 345c78d
src/interface.rs
@@ -49,6 +49,7 @@ impl Interface {
49
if let Some(iface) = convert_ifaddrs(cur) {
50
ret.push(iface);
51
}
52
+
53
//TODO: do something else maybe?
54
cur = unsafe { (*cur).ifa_next };
55
@@ -68,7 +69,7 @@ fn convert_ifaddrs (ifa: *mut ffi::ifaddrs) -> Option<Interface> {
68
69
Err(_) => return None,
70
};
71
- let kind = if ifa.ifa_addr == ptr::null_mut() {
72
+ let kind = if ifa.ifa_addr != ptr::null_mut() {
73
match unsafe { *ifa.ifa_addr }.sa_family as i32 {
74
ffi::AF_PACKET => Kind::Packet,
75
socket::AF_INET => Kind::Ipv4,
0 commit comments