diff options
Diffstat (limited to 'src/sys/socket/mod.rs')
-rw-r--r-- | src/sys/socket/mod.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/sys/socket/mod.rs b/src/sys/socket/mod.rs index d651b259..1c12c5f8 100644 --- a/src/sys/socket/mod.rs +++ b/src/sys/socket/mod.rs @@ -33,6 +33,8 @@ pub use self::addr::{ pub use ::sys::socket::addr::netlink::NetlinkAddr; #[cfg(any(target_os = "android", target_os = "linux"))] pub use sys::socket::addr::alg::AlgAddr; +#[cfg(target_os = "linux")] +pub use sys::socket::addr::vsock::VsockAddr; pub use libc::{ cmsghdr, @@ -1254,6 +1256,11 @@ pub unsafe fn sockaddr_storage_to_addr( use libc::sockaddr_alg; Ok(SockAddr::Alg(AlgAddr(*(addr as *const _ as *const sockaddr_alg)))) } + #[cfg(target_os = "linux")] + libc::AF_VSOCK => { + use libc::sockaddr_vm; + Ok(SockAddr::Vsock(VsockAddr(*(addr as *const _ as *const sockaddr_vm)))) + } af => panic!("unexpected address family {}", af), } } |