diff options
author | Daniel Lezcano <dlezcano@fr.ibm.com> | 2008-03-05 13:46:31 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-03-05 13:46:31 -0500 |
commit | 300bf591deca8d108799e70e9300dc31765643e3 (patch) | |
tree | 24f0399015f1b42e967e1bdc9eaacddc8622d35b /net | |
parent | 075de9395760d6d181078f863e676e81c06e1af2 (diff) |
[NETNS][IPV6] proc - protect snmp6 from non-init_net calls
This patchset avoids creation of the /proc entry for snmp6 when
the call is made from a network namespace different from the init_net.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv6/proc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c index 5ba7ae849d04..2453f2229ef7 100644 --- a/net/ipv6/proc.c +++ b/net/ipv6/proc.c | |||
@@ -220,6 +220,9 @@ int snmp6_register_dev(struct inet6_dev *idev) | |||
220 | if (!idev || !idev->dev) | 220 | if (!idev || !idev->dev) |
221 | return -EINVAL; | 221 | return -EINVAL; |
222 | 222 | ||
223 | if (idev->dev->nd_net != &init_net) | ||
224 | return 0; | ||
225 | |||
223 | if (!proc_net_devsnmp6) | 226 | if (!proc_net_devsnmp6) |
224 | return -ENOENT; | 227 | return -ENOENT; |
225 | 228 | ||