mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-07-01 23:53:16 -04:00
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>
This commit is contained in:
parent
2a43ca0aa9
commit
c62cce2cae
4 changed files with 19 additions and 1 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue