summaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/sockios.h
diff options
context:
space:
mode:
authorAndrey Vagin2016-10-25 03:29:13 +0200
committerDavid S. Miller2016-10-31 15:56:36 +0100
commitc62cce2caee558e18aa05c01c2fd3b40f07174f2 (patch)
treef652d443eb8394c24772bcee4cf15f3a1a6586f1 /include/uapi/linux/sockios.h
parentmv643xx_eth: Properly resolve merge conflict. (diff)
downloadkernel-qcow2-linux-c62cce2caee558e18aa05c01c2fd3b40f07174f2.tar.gz
kernel-qcow2-linux-c62cce2caee558e18aa05c01c2fd3b40f07174f2.tar.xz
kernel-qcow2-linux-c62cce2caee558e18aa05c01c2fd3b40f07174f2.zip
net: add an ioctl to get a socket network namespace
Each socket operates in a network namespace where it has been created, so if we want to dump and restore a socket, we have to know its network namespace. We have a socket_diag to get information about sockets, it doesn't report sockets which are not bound or connected. This patch introduces a new socket ioctl, which is called SIOCGSKNS and used to get a file descriptor for a socket network namespace. A task must have CAP_NET_ADMIN in a target network namespace to use this ioctl. Cc: "David S. Miller" <davem@davemloft.net> Cc: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Andrei Vagin <avagin@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/uapi/linux/sockios.h')
-rw-r--r--include/uapi/linux/sockios.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/uapi/linux/sockios.h b/include/uapi/linux/sockios.h
index 8e7890b26d9a..83cc54ce6081 100644
--- a/include/uapi/linux/sockios.h
+++ b/include/uapi/linux/sockios.h
@@ -84,6 +84,7 @@
#define SIOCWANDEV 0x894A /* get/set netdev parameters */
#define SIOCOUTQNSD 0x894B /* output queue size (not sent only) */
+#define SIOCGSKNS 0x894C /* get socket network namespace */
/* ARP cache control calls. */
/* 0x8950 - 0x8952 * obsolete calls, don't re-use */