diff --git a/net_util/src/lib.rs b/net_util/src/lib.rs index 117f2b1a6..1cadb7f28 100644 --- a/net_util/src/lib.rs +++ b/net_util/src/lib.rs @@ -67,7 +67,7 @@ fn create_sockaddr(ip_addr: net::Ipv4Addr) -> net_gen::sockaddr { sin_family: net_gen::AF_INET as u16, sin_port: 0, // SAFETY: ip_addr can be safely transmute to in_addr - sin_addr: unsafe { mem::transmute(ip_addr.octets()) }, + sin_addr: unsafe { mem::transmute::<[u8; 4], net_gen::inn::in_addr>(ip_addr.octets()) }, __pad: [0; 8usize], };