[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1371175607-1405-3-git-send-email-gaofeng@cn.fujitsu.com>
Date: Fri, 14 Jun 2013 10:06:46 +0800
From: Gao feng <gaofeng@...fujitsu.com>
To: davem@...emloft.net
Cc: ebiederm@...ssion.com, netdev@...r.kernel.org,
Gao feng <gaofeng@...fujitsu.com>
Subject: [PATCH v2 3/4] 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@...fujitsu.com>
---
net/core/neighbour.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 2ec1faf..5e0fe89 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)
}
}
+ err = -ENOENT;
+ if ((tb[NDTA_THRESH1] || tb[NDTA_THRESH2] ||
+ tb[NDTA_THRESH3] || tb[NDTA_GC_INTERVAL]) &&
+ !net_eq(net, &init_net))
+ goto errout_tbl_lock;
+
if (tb[NDTA_THRESH1])
tbl->gc_thresh1 = nla_get_u32(tb[NDTA_THRESH1]);
--
1.8.1.4
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists