From: Thomas Karpiniec Date: Fri, 31 May 2024 02:18:40 +0000 (+1000) Subject: Use AF_UNSPEC constant X-Git-Tag: v0.1.0~27 X-Git-Url: https://code.octet-stream.net/netwatcher/commitdiff_plain/046d2240dd3665340cc92ea4639ec9296bf81714?ds=inline Use AF_UNSPEC constant --- 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),