Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

vsock: add VMADDR_CID_LOCAL definition

The VMADDR_CID_RESERVED (1) was used by VMCI, but now it is not
used anymore, so we can reuse it for local communication
(loopback) adding the new well-know CID: VMADDR_CID_LOCAL.

Cc: Jorgen Hansen <jhansen@vmware.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Jorgen Hansen <jhansen@vmware.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Stefano Garzarella and committed by
David S. Miller
ef343b35 c5144fcb

+6 -4
+5 -3
include/uapi/linux/vm_sockets.h
··· 99 99 100 100 #define VMADDR_CID_HYPERVISOR 0 101 101 102 - /* This CID is specific to VMCI and can be considered reserved (even VMCI 103 - * doesn't use it anymore, it's a legacy value from an older release). 102 + /* Use this as the destination CID in an address when referring to the 103 + * local communication (loopback). 104 + * (This was VMADDR_CID_RESERVED, but even VMCI doesn't use it anymore, 105 + * it was a legacy value from an older release). 104 106 */ 105 107 106 - #define VMADDR_CID_RESERVED 1 108 + #define VMADDR_CID_LOCAL 1 107 109 108 110 /* Use this as the destination CID in an address when referring to the host 109 111 * (any process other than the hypervisor). VMCI relies on it being 2, but
+1 -1
net/vmw_vsock/vmci_transport.c
··· 648 648 static bool vmci_transport_stream_allow(u32 cid, u32 port) 649 649 { 650 650 static const u32 non_socket_contexts[] = { 651 - VMADDR_CID_RESERVED, 651 + VMADDR_CID_LOCAL, 652 652 }; 653 653 int i; 654 654