From afaadf170677e570143e0dcd60593c6ab3355575 Mon Sep 17 00:00:00 2001 From: chantra Date: Sun, 27 Oct 2024 17:46:56 -0700 Subject: [PATCH] WinSock::ADRESS_FAMILY is now u16. Since windows-sys-0.45.0, `windows_sys::Win32::Networking::WinSock::ADDRESS_FAMILY` are u16 instead of u32. --- src/device.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/device.rs b/src/device.rs index 561b11fd..3e716604 100644 --- a/src/device.rs +++ b/src/device.rs @@ -266,7 +266,7 @@ impl Address { return None; } - match (*ptr).sa_family as u32 { + match (*ptr).sa_family as u16 { WinSock::AF_INET => { let ptr: *const WinSock::SOCKADDR_IN = std::mem::transmute(ptr); let addr: [u8; 4] = ((*ptr).sin_addr.S_un.S_addr).to_ne_bytes();