aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGao feng <gaofeng@cn.fujitsu.com>2013-06-19 22:01:33 -0400
committerDavid S. Miller <davem@davemloft.net>2013-06-20 00:13:24 -0400
commit170d6f99541600ec7512f1d2b0b0c349009098d2 (patch)
tree939fa57fa9d7f52dc1341e3d43788a7eff8e157c
parentcf89d6b2803ab99ac596f95d585c3057d2be645c (diff)
neigh: only allow init_net to change the default neigh_parms
Though we don't export the /proc/sys/net/ipv[4,6]/neigh/default/ directory to the un-init_net, but we can still use cmd such as "ip ntable change name arp_cache locktime 129" to change the locktime of default neigh_parms. This patch disallows the un-init_net to find out the neigh_table.parms. So the un-init_net will failed to influence the init_net. Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/core/neighbour.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 53eab513955a..86f9b165bbba 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -1419,7 +1419,7 @@ static inline struct neigh_parms *lookup_neigh_parms(struct neigh_table *tbl,
1419 1419
1420 for (p = &tbl->parms; p; p = p->next) { 1420 for (p = &tbl->parms; p; p = p->next) {
1421 if ((p->dev && p->dev->ifindex == ifindex && net_eq(neigh_parms_net(p), net)) || 1421 if ((p->dev && p->dev->ifindex == ifindex && net_eq(neigh_parms_net(p), net)) ||
1422 (!p->dev && !ifindex)) 1422 (!p->dev && !ifindex && net_eq(net, &init_net)))
1423 return p; 1423 return p;
1424 } 1424 }
1425 1425