summaryrefslogtreecommitdiff
path: root/src/ifaddrs.rs
diff options
context:
space:
mode:
authorAlan Somers <asomers@gmail.com>2021-09-28 19:09:15 -0600
committerAlan Somers <asomers@gmail.com>2021-09-28 19:09:15 -0600
commit8d6c2b3a70c650e4aed47d735c9f236ee45e9d26 (patch)
tree2889c0b4e181adcddbdb659ad4c3833a2a2028b7 /src/ifaddrs.rs
parent759b34adea682c5434ea88cea5d666da816149cc (diff)
downloadnix-8d6c2b3a70c650e4aed47d735c9f236ee45e9d26.zip
Revert "Expose SockAddr::from_raw_sockaddr"
This reverts commit ed43d2c65e65dd68c9cf2dcf06f5ec45a44aaccd. As discussed in #1544 the API of this function needs to change. For now, revert the PR that made it public, because it has not yet been included in any release.
Diffstat (limited to 'src/ifaddrs.rs')
-rw-r--r--src/ifaddrs.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ifaddrs.rs b/src/ifaddrs.rs
index 74f34050..ed6328f3 100644
--- a/src/ifaddrs.rs
+++ b/src/ifaddrs.rs
@@ -46,8 +46,8 @@ impl InterfaceAddress {
/// Create an `InterfaceAddress` from the libc struct.
fn from_libc_ifaddrs(info: &libc::ifaddrs) -> InterfaceAddress {
let ifname = unsafe { ffi::CStr::from_ptr(info.ifa_name) };
- let address = unsafe { SockAddr::from_raw_sockaddr(info.ifa_addr) };
- let netmask = unsafe { SockAddr::from_raw_sockaddr(info.ifa_netmask) };
+ let address = unsafe { SockAddr::from_libc_sockaddr(info.ifa_addr) };
+ let netmask = unsafe { SockAddr::from_libc_sockaddr(info.ifa_netmask) };
let mut addr = InterfaceAddress {
interface_name: ifname.to_string_lossy().to_string(),
flags: InterfaceFlags::from_bits_truncate(info.ifa_flags as i32),
@@ -59,9 +59,9 @@ impl InterfaceAddress {
let ifu = get_ifu_from_sockaddr(info);
if addr.flags.contains(InterfaceFlags::IFF_POINTOPOINT) {
- addr.destination = unsafe { SockAddr::from_raw_sockaddr(ifu) };
+ addr.destination = unsafe { SockAddr::from_libc_sockaddr(ifu) };
} else if addr.flags.contains(InterfaceFlags::IFF_BROADCAST) {
- addr.broadcast = unsafe { SockAddr::from_raw_sockaddr(ifu) };
+ addr.broadcast = unsafe { SockAddr::from_libc_sockaddr(ifu) };
}
addr