aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/proc_fs.h
diff options
context:
space:
mode:
authorAndrey Vagin <avagin@openvz.org>2016-10-24 18:29:13 -0700
committerDavid S. Miller <davem@davemloft.net>2016-10-31 10:56:36 -0400
commitc62cce2caee558e18aa05c01c2fd3b40f07174f2 (patch)
treef652d443eb8394c24772bcee4cf15f3a1a6586f1 /include/linux/proc_fs.h
parentmv643xx_eth: Properly resolve merge conflict. (diff)
downloadwireguard-linux-c62cce2caee558e18aa05c01c2fd3b40f07174f2.tar.xz
wireguard-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/linux/proc_fs.h')
-rw-r--r--include/linux/proc_fs.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index b97bf2ef996e..368c7ad06ae5 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -82,4 +82,8 @@ static inline struct proc_dir_entry *proc_net_mkdir(
return proc_mkdir_data(name, 0, parent, net);
}
+struct ns_common;
+int open_related_ns(struct ns_common *ns,
+ struct ns_common *(*get_ns)(struct ns_common *ns));
+
#endif /* _LINUX_PROC_FS_H */