Merge branch 'for-2.6.21' of master.kernel.org:/pub/scm/linux/kernel/git/davej/agpgart
[pandora-kernel.git] / net / core / neighbour.c
index 512eed9..cfc6001 100644 (file)
@@ -19,7 +19,6 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/socket.h>
-#include <linux/sched.h>
 #include <linux/netdevice.h>
 #include <linux/proc_fs.h>
 #ifdef CONFIG_SYSCTL
@@ -141,6 +140,8 @@ static int neigh_forced_gc(struct neigh_table *tbl)
                                n->dead = 1;
                                shrunk  = 1;
                                write_unlock(&n->lock);
+                               if (n->parms->neigh_cleanup)
+                                       n->parms->neigh_cleanup(n);
                                neigh_release(n);
                                continue;
                        }
@@ -212,6 +213,8 @@ static void neigh_flush_dev(struct neigh_table *tbl, struct net_device *dev)
                                NEIGH_PRINTK2("neigh %p is stray.\n", n);
                        }
                        write_unlock(&n->lock);
+                       if (n->parms->neigh_cleanup)
+                               n->parms->neigh_cleanup(n);
                        neigh_release(n);
                }
        }
@@ -583,9 +586,6 @@ void neigh_destroy(struct neighbour *neigh)
                        kfree(hh);
        }
 
-       if (neigh->parms->neigh_destructor)
-               (neigh->parms->neigh_destructor)(neigh);
-
        skb_queue_purge(&neigh->arp_queue);
 
        dev_put(neigh->dev);
@@ -676,6 +676,8 @@ static void neigh_periodic_timer(unsigned long arg)
                        *np = n->next;
                        n->dead = 1;
                        write_unlock(&n->lock);
+                       if (n->parms->neigh_cleanup)
+                               n->parms->neigh_cleanup(n);
                        neigh_release(n);
                        continue;
                }
@@ -2089,8 +2091,11 @@ void __neigh_for_each_release(struct neigh_table *tbl,
                        } else
                                np = &n->next;
                        write_unlock(&n->lock);
-                       if (release)
+                       if (release) {
+                               if (n->parms->neigh_cleanup)
+                                       n->parms->neigh_cleanup(n);
                                neigh_release(n);
+                       }
                }
        }
 }
@@ -2708,7 +2713,7 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
        t->neigh_proto_dir[0].child    = t->neigh_neigh_dir;
        t->neigh_root_dir[0].child     = t->neigh_proto_dir;
 
-       t->sysctl_header = register_sysctl_table(t->neigh_root_dir, 0);
+       t->sysctl_header = register_sysctl_table(t->neigh_root_dir);
        if (!t->sysctl_header) {
                err = -ENOBUFS;
                goto free_procname;