This adds iproute2 support for the "vsock" generic netlink family from
the kernel series "vsock: assign the guest vsock device to a network
namespace":

  
https://lore.kernel.org/all/[email protected]/

The guest's vsock device is not a netdev, so it cannot be moved with
"ip link set DEV netns". The kernel series adds VSOCK_CMD_DEV_NETNS_SET,
which assigns the device to the namespace the request was sent from, and
VSOCK_CMD_DEV_NETNS_GET, which reports where it is. This series exposes
both through a new "ip vsock" object:

  # ip netns add guest
  # ip vsock set netns guest
  # ip vsock show
  vsock netns guest
  # ip -n guest vsock show
  vsock

I considered using "ip link", but I opted away from that option to avoid
the scenario (however unlikely) of masking out / colliding with a netdev
with the name "vsock".

Signed-off-by: Bobby Eshleman <[email protected]>
---
Bobby Eshleman (2):
      uapi: add vsock_netlink.h
      ip: add "ip vsock" to move the guest vsock device to a netns

 include/uapi/linux/vsock_netlink.h |  28 +++++
 ip/Makefile                        |   2 +-
 ip/ip.c                            |   3 +-
 ip/ip_common.h                     |   1 +
 ip/ipvsock.c                       | 205 +++++++++++++++++++++++++++++++++++++
 man/man8/ip-vsock.8                | 121 ++++++++++++++++++++++
 man/man8/ip.8                      |   7 +-
 7 files changed, 364 insertions(+), 3 deletions(-)
---
base-commit: 204a721033556114c81c47d00375f2d52e98e463
change-id: 20261105-vsock-guest-ns-4bf1ce74742e

Best regards,
-- 
Bobby Eshleman <[email protected]>


Reply via email to