aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_main.c6
-rw-r--r--include/net/neighbour.h2
-rw-r--r--net/atm/clip.c9
-rw-r--r--net/core/neighbour.c14
4 files changed, 14 insertions, 17 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index 0741c6d1337c..f2a40ae8e7d0 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -814,7 +814,7 @@ static void ipoib_set_mcast_list(struct net_device *dev)
814 queue_work(ipoib_workqueue, &priv->restart_task); 814 queue_work(ipoib_workqueue, &priv->restart_task);
815} 815}
816 816
817static void ipoib_neigh_destructor(struct neighbour *n) 817static void ipoib_neigh_cleanup(struct neighbour *n)
818{ 818{
819 struct ipoib_neigh *neigh; 819 struct ipoib_neigh *neigh;
820 struct ipoib_dev_priv *priv = netdev_priv(n->dev); 820 struct ipoib_dev_priv *priv = netdev_priv(n->dev);
@@ -822,7 +822,7 @@ static void ipoib_neigh_destructor(struct neighbour *n)
822 struct ipoib_ah *ah = NULL; 822 struct ipoib_ah *ah = NULL;
823 823
824 ipoib_dbg(priv, 824 ipoib_dbg(priv,
825 "neigh_destructor for %06x " IPOIB_GID_FMT "\n", 825 "neigh_cleanup for %06x " IPOIB_GID_FMT "\n",
826 IPOIB_QPN(n->ha), 826 IPOIB_QPN(n->ha),
827 IPOIB_GID_RAW_ARG(n->ha + 4)); 827 IPOIB_GID_RAW_ARG(n->ha + 4));
828 828
@@ -874,7 +874,7 @@ void ipoib_neigh_free(struct net_device *dev, struct ipoib_neigh *neigh)
874 874
875static int ipoib_neigh_setup_dev(struct net_device *dev, struct neigh_parms *parms) 875static int ipoib_neigh_setup_dev(struct net_device *dev, struct neigh_parms *parms)
876{ 876{
877 parms->neigh_destructor = ipoib_neigh_destructor; 877 parms->neigh_cleanup = ipoib_neigh_cleanup;
878 878
879 return 0; 879 return 0;
880} 880}
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index 3725b93c52f3..ad7fe1121412 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -36,7 +36,7 @@ struct neigh_parms
36 struct net_device *dev; 36 struct net_device *dev;
37 struct neigh_parms *next; 37 struct neigh_parms *next;
38 int (*neigh_setup)(struct neighbour *); 38 int (*neigh_setup)(struct neighbour *);
39 void (*neigh_destructor)(struct neighbour *); 39 void (*neigh_cleanup)(struct neighbour *);
40 struct neigh_table *tbl; 40 struct neigh_table *tbl;
41 41
42 void *sysctl_table; 42 void *sysctl_table;
diff --git a/net/atm/clip.c b/net/atm/clip.c
index ebb5d0ce8b6f..8c3825816085 100644
--- a/net/atm/clip.c
+++ b/net/atm/clip.c
@@ -261,14 +261,6 @@ static void clip_pop(struct atm_vcc *vcc, struct sk_buff *skb)
261 spin_unlock_irqrestore(&PRIV(dev)->xoff_lock, flags); 261 spin_unlock_irqrestore(&PRIV(dev)->xoff_lock, flags);
262} 262}
263 263
264static void clip_neigh_destroy(struct neighbour *neigh)
265{
266 DPRINTK("clip_neigh_destroy (neigh %p)\n", neigh);
267 if (NEIGH2ENTRY(neigh)->vccs)
268 printk(KERN_CRIT "clip_neigh_destroy: vccs != NULL !!!\n");
269 NEIGH2ENTRY(neigh)->vccs = (void *) NEIGHBOR_DEAD;
270}
271
272static void clip_neigh_solicit(struct neighbour *neigh, struct sk_buff *skb) 264static void clip_neigh_solicit(struct neighbour *neigh, struct sk_buff *skb)
273{ 265{
274 DPRINTK("clip_neigh_solicit (neigh %p, skb %p)\n", neigh, skb); 266 DPRINTK("clip_neigh_solicit (neigh %p, skb %p)\n", neigh, skb);
@@ -342,7 +334,6 @@ static struct neigh_table clip_tbl = {
342 /* parameters are copied from ARP ... */ 334 /* parameters are copied from ARP ... */
343 .parms = { 335 .parms = {
344 .tbl = &clip_tbl, 336 .tbl = &clip_tbl,
345 .neigh_destructor = clip_neigh_destroy,
346 .base_reachable_time = 30 * HZ, 337 .base_reachable_time = 30 * HZ,
347 .retrans_time = 1 * HZ, 338 .retrans_time = 1 * HZ,
348 .gc_staletime = 60 * HZ, 339 .gc_staletime = 60 * HZ,
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 3183142c6044..cfc60019cf92 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -140,6 +140,8 @@ static int neigh_forced_gc(struct neigh_table *tbl)
140 n->dead = 1; 140 n->dead = 1;
141 shrunk = 1; 141 shrunk = 1;
142 write_unlock(&n->lock); 142 write_unlock(&n->lock);
143 if (n->parms->neigh_cleanup)
144 n->parms->neigh_cleanup(n);
143 neigh_release(n); 145 neigh_release(n);
144 continue; 146 continue;
145 } 147 }
@@ -211,6 +213,8 @@ static void neigh_flush_dev(struct neigh_table *tbl, struct net_device *dev)
211 NEIGH_PRINTK2("neigh %p is stray.\n", n); 213 NEIGH_PRINTK2("neigh %p is stray.\n", n);
212 } 214 }
213 write_unlock(&n->lock); 215 write_unlock(&n->lock);
216 if (n->parms->neigh_cleanup)
217 n->parms->neigh_cleanup(n);
214 neigh_release(n); 218 neigh_release(n);
215 } 219 }
216 } 220 }
@@ -582,9 +586,6 @@ void neigh_destroy(struct neighbour *neigh)
582 kfree(hh); 586 kfree(hh);
583 } 587 }
584 588
585 if (neigh->parms->neigh_destructor)
586 (neigh->parms->neigh_destructor)(neigh);
587
588 skb_queue_purge(&neigh->arp_queue); 589 skb_queue_purge(&neigh->arp_queue);
589 590
590 dev_put(neigh->dev); 591 dev_put(neigh->dev);
@@ -675,6 +676,8 @@ static void neigh_periodic_timer(unsigned long arg)
675 *np = n->next; 676 *np = n->next;
676 n->dead = 1; 677 n->dead = 1;
677 write_unlock(&n->lock); 678 write_unlock(&n->lock);
679 if (n->parms->neigh_cleanup)
680 n->parms->neigh_cleanup(n);
678 neigh_release(n); 681 neigh_release(n);
679 continue; 682 continue;
680 } 683 }
@@ -2088,8 +2091,11 @@ void __neigh_for_each_release(struct neigh_table *tbl,
2088 } else 2091 } else
2089 np = &n->next; 2092 np = &n->next;
2090 write_unlock(&n->lock); 2093 write_unlock(&n->lock);
2091 if (release) 2094 if (release) {
2095 if (n->parms->neigh_cleanup)
2096 n->parms->neigh_cleanup(n);
2092 neigh_release(n); 2097 neigh_release(n);
2098 }
2093 } 2099 }
2094 } 2100 }
2095} 2101}