mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 13:45:20 +00:00
net_util: annotate a transmute call
Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
parent
24f8d15b14
commit
4f1e74b553
@ -67,7 +67,7 @@ fn create_sockaddr(ip_addr: net::Ipv4Addr) -> net_gen::sockaddr {
|
|||||||
sin_family: net_gen::AF_INET as u16,
|
sin_family: net_gen::AF_INET as u16,
|
||||||
sin_port: 0,
|
sin_port: 0,
|
||||||
// SAFETY: ip_addr can be safely transmute to in_addr
|
// 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],
|
__pad: [0; 8usize],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user