Skip to content

Commit 5e491c8

Browse files
Merge #1407
1407: Fix test_vsock failure on VMADDR_CID_LOCAL testing and re-enable it r=asomers a=stefano-garzarella 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 <[email protected]> Co-authored-by: Stefano Garzarella <[email protected]>
2 parents fde9ebc + 5d17a60 commit 5e491c8

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

test/sys/test_socket.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1491,7 +1491,6 @@ pub fn test_recv_ipv6pktinfo() {
14911491
}
14921492

14931493
#[cfg(any(target_os = "android", target_os = "linux"))]
1494-
#[cfg_attr(not(target_arch = "x86_64"), ignore)]
14951494
#[test]
14961495
pub fn test_vsock() {
14971496
use libc;
@@ -1508,17 +1507,11 @@ pub fn test_vsock() {
15081507
SockFlag::empty(), None)
15091508
.expect("socket failed");
15101509

1511-
// VMADDR_CID_HYPERVISOR and VMADDR_CID_LOCAL are reserved, so we expect
1512-
// an EADDRNOTAVAIL error.
1510+
// VMADDR_CID_HYPERVISOR is reserved, so we expect an EADDRNOTAVAIL error.
15131511
let sockaddr = SockAddr::new_vsock(libc::VMADDR_CID_HYPERVISOR, port);
15141512
assert_eq!(bind(s1, &sockaddr).err(),
15151513
Some(Error::Sys(Errno::EADDRNOTAVAIL)));
15161514

1517-
let sockaddr = SockAddr::new_vsock(libc::VMADDR_CID_LOCAL, port);
1518-
assert_eq!(bind(s1, &sockaddr).err(),
1519-
Some(Error::Sys(Errno::EADDRNOTAVAIL)));
1520-
1521-
15221515
let sockaddr = SockAddr::new_vsock(libc::VMADDR_CID_ANY, port);
15231516
assert_eq!(bind(s1, &sockaddr), Ok(()));
15241517
listen(s1, 10).expect("listen failed");

0 commit comments

Comments
 (0)