X-Git-Url: https://code.octet-stream.net/netwatcher/blobdiff_plain/0ecc1ee8ddfdf50d813fe18794eb27ac4ec0cf56..846b618fe219c44dfc7b3a13aadace2198442c9c:/src/imp_win.rs?ds=sidebyside diff --git a/src/imp_win.rs b/src/imp_win.rs index 15b115c..f34b207 100644 --- a/src/imp_win.rs +++ b/src/imp_win.rs @@ -12,7 +12,9 @@ use windows::Win32::NetworkManagement::IpHelper::{ use windows::Win32::NetworkManagement::IpHelper::{ GAA_FLAG_SKIP_ANYCAST, GAA_FLAG_SKIP_MULTICAST, IP_ADAPTER_ADDRESSES_LH, }; -use windows::Win32::Networking::WinSock::{AF_INET, AF_INET6, SOCKADDR, SOCKADDR_IN, SOCKADDR_IN6}; +use windows::Win32::Networking::WinSock::{ + AF_INET, AF_INET6, AF_UNSPEC, SOCKADDR, SOCKADDR_IN, SOCKADDR_IN6, +}; use crate::{Error, IfIndex, Interface}; @@ -27,7 +29,7 @@ pub(crate) fn list_interfaces() -> Result, Error> { loop { let bufptr = &mut buf[0] as *mut _ as *mut IP_ADAPTER_ADDRESSES_LH; let res = GetAdaptersAddresses( - 0, /* AF_UNSPEC */ + AF_UNSPEC.0.into(), GAA_FLAG_SKIP_ANYCAST | GAA_FLAG_SKIP_MULTICAST, None, Some(bufptr),