Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=486b51d3706c5493b6c50992eaaafc44e628a7ed
Commit:     486b51d3706c5493b6c50992eaaafc44e628a7ed
Parent:     72132c1b6c7a7605cdfde86a9f58b6ca2b2195a6
Author:     Denis V. Lunev <[EMAIL PROTECTED]>
AuthorDate: Mon Jan 14 22:59:59 2008 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Jan 28 15:02:10 2008 -0800

    [ARP]: Remove overkill checks from neigh_param_alloc.
    
    Valid network device is always passed into neigh_param_alloc, so
    remove extra checking for dev == NULL. Additionally, cleanup bogus
    netns assignment.
    
    Signed-off-by: Denis V. Lunev <[EMAIL PROTECTED]>
    Signed-off-by: Pavel Emelyanov <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/core/neighbour.c |   18 +++++++-----------
 1 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 19c0dd1..62d4784 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -1291,10 +1291,7 @@ struct neigh_parms *neigh_parms_alloc(struct net_device 
*dev,
        struct neigh_parms *p, *ref;
        struct net *net;
 
-       net = &init_net;
-       if (dev)
-               net = dev->nd_net;
-
+       net = dev->nd_net;
        ref = lookup_neigh_params(tbl, net, 0);
        if (!ref)
                return NULL;
@@ -1306,15 +1303,14 @@ struct neigh_parms *neigh_parms_alloc(struct net_device 
*dev,
                INIT_RCU_HEAD(&p->rcu_head);
                p->reachable_time =
                                neigh_rand_reach_time(p->base_reachable_time);
-               if (dev) {
-                       if (dev->neigh_setup && dev->neigh_setup(dev, p)) {
-                               kfree(p);
-                               return NULL;
-                       }
 
-                       dev_hold(dev);
-                       p->dev = dev;
+               if (dev->neigh_setup && dev->neigh_setup(dev, p)) {
+                       kfree(p);
+                       return NULL;
                }
+
+               dev_hold(dev);
+               p->dev = dev;
                p->net = hold_net(net);
                p->sysctl_table = NULL;
                write_lock_bh(&tbl->lock);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to