diff options
author | Stefano Garzarella <sgarzare@redhat.com> | 2021-03-22 09:39:50 +0100 |
---|---|---|
committer | Stefano Garzarella <sgarzare@redhat.com> | 2021-03-22 09:51:50 +0100 |
commit | 532e238d5eb663bfd8e114e048b4660f7dcf096b (patch) | |
tree | 50e919879a9259441a397324e91a1931f8ea50e6 /test/sys/test_socket.rs | |
parent | fde9ebc6060ba7d5f0f49bafe82f332003ea9605 (diff) | |
download | nix-532e238d5eb663bfd8e114e048b4660f7dcf096b.zip |
Fix test_vsock failure on VMADDR_CID_LOCAL testing
Starting from Linux 5.6, VMADDR_CID_LOCAL is supported to do local
communication (loopback device).
Before Linux 5.6 it was called VMADDR_CID_RESERVED and was not
supported, so we could expect an EADDRNOTAVAIL, but now this address
is supported and handled by the 'vsock_loopback' kernel module loaded
automatically if no other vsock transports are loaded.
Issue #1310
Issue #1403
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Diffstat (limited to 'test/sys/test_socket.rs')
-rw-r--r-- | test/sys/test_socket.rs | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/test/sys/test_socket.rs b/test/sys/test_socket.rs index 873fac67..a8aff296 100644 --- a/test/sys/test_socket.rs +++ b/test/sys/test_socket.rs @@ -1508,17 +1508,11 @@ pub fn test_vsock() { SockFlag::empty(), None) .expect("socket failed"); - // VMADDR_CID_HYPERVISOR and VMADDR_CID_LOCAL are reserved, so we expect - // an EADDRNOTAVAIL error. + // VMADDR_CID_HYPERVISOR is reserved, so we expect an EADDRNOTAVAIL error. let sockaddr = SockAddr::new_vsock(libc::VMADDR_CID_HYPERVISOR, port); assert_eq!(bind(s1, &sockaddr).err(), Some(Error::Sys(Errno::EADDRNOTAVAIL))); - let sockaddr = SockAddr::new_vsock(libc::VMADDR_CID_LOCAL, port); - assert_eq!(bind(s1, &sockaddr).err(), - Some(Error::Sys(Errno::EADDRNOTAVAIL))); - - let sockaddr = SockAddr::new_vsock(libc::VMADDR_CID_ANY, port); assert_eq!(bind(s1, &sockaddr), Ok(())); listen(s1, 10).expect("listen failed"); |