diff options
author | Gao feng <gaofeng@cn.fujitsu.com> | 2013-06-19 22:01:34 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-06-20 00:13:24 -0400 |
commit | dc25c676f54addb10e598daa9da9b8dd4fd487ab (patch) | |
tree | ec051c49410942a463d23fc9583a649851c8bff5 /net | |
parent | 170d6f99541600ec7512f1d2b0b0c349009098d2 (diff) |
neigh: disallow un-init_net to change thresh of neigh
thresh and interval are global resources,
only init net can change them.
Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/neighbour.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 86f9b165bbba..2569ab2cafbe 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c | |||
@@ -2049,6 +2049,12 @@ static int neightbl_set(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
2049 | } | 2049 | } |
2050 | } | 2050 | } |
2051 | 2051 | ||
2052 | err = -ENOENT; | ||
2053 | if ((tb[NDTA_THRESH1] || tb[NDTA_THRESH2] || | ||
2054 | tb[NDTA_THRESH3] || tb[NDTA_GC_INTERVAL]) && | ||
2055 | !net_eq(net, &init_net)) | ||
2056 | goto errout_tbl_lock; | ||
2057 | |||
2052 | if (tb[NDTA_THRESH1]) | 2058 | if (tb[NDTA_THRESH1]) |
2053 | tbl->gc_thresh1 = nla_get_u32(tb[NDTA_THRESH1]); | 2059 | tbl->gc_thresh1 = nla_get_u32(tb[NDTA_THRESH1]); |
2054 | 2060 | ||