netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 RESEND 1/3] neigh: no need to call lookup_neigh_parms in neigh_parms_alloc
@ 2013-06-20  2:01 Gao feng
  2013-06-20  2:01 ` [PATCH v3 RESEND 2/3] neigh: only allow init_net to change the default neigh_parms Gao feng
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Gao feng @ 2013-06-20  2:01 UTC (permalink / raw)
  To: davem; +Cc: ebiederm, netdev, Gao feng

neigh_table.parms always exist and is initialized,kmemdup
can use it to create new neigh_parms, actually lookup_neigh_parms
here will return neigh_table.parms too.

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
---
 net/core/neighbour.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 5c56b21..62d9757 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -1429,15 +1429,11 @@ static inline struct neigh_parms *lookup_neigh_parms(struct neigh_table *tbl,
 struct neigh_parms *neigh_parms_alloc(struct net_device *dev,
 				      struct neigh_table *tbl)
 {
-	struct neigh_parms *p, *ref;
+	struct neigh_parms *p;
 	struct net *net = dev_net(dev);
 	const struct net_device_ops *ops = dev->netdev_ops;
 
-	ref = lookup_neigh_parms(tbl, net, 0);
-	if (!ref)
-		return NULL;
-
-	p = kmemdup(ref, sizeof(*p), GFP_KERNEL);
+	p = kmemdup(&tbl->parms, sizeof(*p), GFP_KERNEL);
 	if (p) {
 		p->tbl		  = tbl;
 		atomic_set(&p->refcnt, 1);
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-06-20  4:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-20  2:01 [PATCH v3 RESEND 1/3] neigh: no need to call lookup_neigh_parms in neigh_parms_alloc Gao feng
2013-06-20  2:01 ` [PATCH v3 RESEND 2/3] neigh: only allow init_net to change the default neigh_parms Gao feng
2013-06-20  4:13   ` David Miller
2013-06-20  2:01 ` [PATCH v3 RESEND 3/3] neigh: disallow un-init_net to change thresh of neigh Gao feng
2013-06-20  4:14   ` David Miller
2013-06-20  4:13 ` [PATCH v3 RESEND 1/3] neigh: no need to call lookup_neigh_parms in neigh_parms_alloc David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).