diff --git a/src/interface/macos.rs b/src/interface/macos.rs index 0b1bc60..53069e5 100644 --- a/src/interface/macos.rs +++ b/src/interface/macos.rs @@ -4,10 +4,12 @@ use system_configuration::network_configuration; fn get_if_type_from_id(type_id: String) -> InterfaceType { match type_id.as_str() { + "Bridge" => InterfaceType::Bridge, "Ethernet" => InterfaceType::Ethernet, "IEEE80211" => InterfaceType::Wireless80211, + "Loopback" => InterfaceType::Loopback, + "Modem" => InterfaceType::GenericModem, "PPP" => InterfaceType::Ppp, - "Bridge" => InterfaceType::Bridge, _ => InterfaceType::Unknown, } } diff --git a/src/interface/unix.rs b/src/interface/unix.rs index 4b186ed..0eed005 100644 --- a/src/interface/unix.rs +++ b/src/interface/unix.rs @@ -226,7 +226,13 @@ fn sockaddr_to_network_addr(sa: *mut libc::sockaddr) -> (Option, Option } } -#[cfg(any(target_os = "openbsd", target_os = "freebsd", target_os = "netbsd"))] +#[cfg(any( + target_os = "macos", + target_os = "ios", + target_os = "openbsd", + target_os = "freebsd", + target_os = "netbsd" +))] fn get_interface_type(addr_ref: &libc::ifaddrs) -> InterfaceType { if !addr_ref.ifa_data.is_null() { let if_data = unsafe { &*(addr_ref.ifa_data as *const libc::if_data) }; @@ -236,12 +242,7 @@ fn get_interface_type(addr_ref: &libc::ifaddrs) -> InterfaceType { } } -#[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "macos", - target_os = "ios" -))] +#[cfg(any(target_os = "linux", target_os = "android"))] fn get_interface_type(_addr_ref: &libc::ifaddrs) -> InterfaceType { InterfaceType::Unknown }