ssh: handle VMADDR_CID_ANY in a couple places (#41230)

Originally reported in Ubuntu as
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/2145027.
This commit is contained in:
Daan De Meyer
2026-03-22 20:07:53 +01:00
committed by GitHub
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -1794,7 +1794,7 @@ int vsock_get_local_cid(unsigned *ret) {
/* If ret == NULL, we're just want to check if AF_VSOCK is available, so accept
* any address. Otherwise, filter out special addresses that are cannot be used
* to identify _this_ machine from the outside. */
if (ret && IN_SET(tmp, VMADDR_CID_LOCAL, VMADDR_CID_HOST))
if (ret && IN_SET(tmp, VMADDR_CID_LOCAL, VMADDR_CID_HOST, VMADDR_CID_ANY))
return log_debug_errno(SYNTHETIC_ERRNO(EADDRNOTAVAIL),
"IOCTL_VM_SOCKETS_GET_LOCAL_CID returned special value (%u), ignoring.", tmp);