diff options
author | David S. Miller <davem@davemloft.net> | 2018-02-15 15:34:42 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-02-15 15:35:11 -0500 |
commit | c402fb7e380c142f2ad3e94d4a1a096fc55b643f (patch) | |
tree | 379cb186c759641311ec2eed0c3e1aba9e30fa3c /net | |
parent | bdc8587ad75d9a42a8165f932c2dfff4d5b877e4 (diff) | |
parent | f2780d6d74756bc1d7ba32ff3dd0de4afd7c7e1e (diff) | |
download | op-kernel-dev-c402fb7e380c142f2ad3e94d4a1a096fc55b643f.zip op-kernel-dev-c402fb7e380c142f2ad3e94d4a1a096fc55b643f.tar.gz |
Merge branch 'tunchr-get-netns'
Kirill Tkhai says:
====================
net: Add ioctl() SIOCGSKNS cmd to allow obtaining net ns of tun device
Currently, it's not possible to get or check net namespace,
which was used to create tun socket. User may have two tun
devices with the same names in different nets, and there
is no way to differ them each other.
The patchset adds support for ioctl() cmd SIOCGSKNS for tun
devices. It will allow people to obtain net namespace file
descriptor like we allow to do that for sockets in general.
v2: Add new patch [2/3] to export open_related_ns().
====================
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/socket.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/socket.c b/net/socket.c index d83e804..ab58e57 100644 --- a/net/socket.c +++ b/net/socket.c @@ -990,10 +990,11 @@ static long sock_do_ioctl(struct net *net, struct socket *sock, * what to do with it - that's up to the protocol still. */ -static struct ns_common *get_net_ns(struct ns_common *ns) +struct ns_common *get_net_ns(struct ns_common *ns) { return &get_net(container_of(ns, struct net, ns))->ns; } +EXPORT_SYMBOL_GPL(get_net_ns); static long sock_ioctl(struct file *file, unsigned cmd, unsigned long arg) { |