diff options
author | David S. Miller <davem@davemloft.net> | 2011-12-19 15:04:41 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-12-19 15:04:41 -0500 |
commit | 447f219190bf0368b8b36cf60155744cb43510df (patch) | |
tree | 7e6c95b20ea8fe8f819fceb7399602df72061c48 | |
parent | 72be84f1c21c0ddba1081291072d7acc9ccddf5f (diff) |
Revert "net: Remove unused neighbour layer ops."
This reverts commit 5c3ddec73d01a1fae9409c197078cb02c42238c3.
S390 qeth driver actually still uses the setup ops.
Reported-by: Frank Blaschka <blaschka@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/linux/netdevice.h | 1 | ||||
-rw-r--r-- | include/net/neighbour.h | 1 | ||||
-rw-r--r-- | net/core/neighbour.c | 10 |
3 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 6b9d4edb7c26..603730804da5 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -974,6 +974,7 @@ struct net_device_ops { | |||
974 | int (*ndo_set_features)(struct net_device *dev, | 974 | int (*ndo_set_features)(struct net_device *dev, |
975 | netdev_features_t features); | 975 | netdev_features_t features); |
976 | int (*ndo_neigh_construct)(struct neighbour *n); | 976 | int (*ndo_neigh_construct)(struct neighbour *n); |
977 | void (*ndo_neigh_destroy)(struct neighbour *n); | ||
977 | }; | 978 | }; |
978 | 979 | ||
979 | /* | 980 | /* |
diff --git a/include/net/neighbour.h b/include/net/neighbour.h index 6814c4d61c1c..e31f0a86f9b7 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h | |||
@@ -43,6 +43,7 @@ struct neigh_parms { | |||
43 | #endif | 43 | #endif |
44 | struct net_device *dev; | 44 | struct net_device *dev; |
45 | struct neigh_parms *next; | 45 | struct neigh_parms *next; |
46 | int (*neigh_setup)(struct neighbour *); | ||
46 | void (*neigh_cleanup)(struct neighbour *); | 47 | void (*neigh_cleanup)(struct neighbour *); |
47 | struct neigh_table *tbl; | 48 | struct neigh_table *tbl; |
48 | 49 | ||
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index d57a40a2598c..4af151e1bf5d 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c | |||
@@ -497,6 +497,13 @@ struct neighbour *neigh_create(struct neigh_table *tbl, const void *pkey, | |||
497 | } | 497 | } |
498 | } | 498 | } |
499 | 499 | ||
500 | /* Device specific setup. */ | ||
501 | if (n->parms->neigh_setup && | ||
502 | (error = n->parms->neigh_setup(n)) < 0) { | ||
503 | rc = ERR_PTR(error); | ||
504 | goto out_neigh_release; | ||
505 | } | ||
506 | |||
500 | n->confirmed = jiffies - (n->parms->base_reachable_time << 1); | 507 | n->confirmed = jiffies - (n->parms->base_reachable_time << 1); |
501 | 508 | ||
502 | write_lock_bh(&tbl->lock); | 509 | write_lock_bh(&tbl->lock); |
@@ -710,6 +717,9 @@ void neigh_destroy(struct neighbour *neigh) | |||
710 | skb_queue_purge(&neigh->arp_queue); | 717 | skb_queue_purge(&neigh->arp_queue); |
711 | neigh->arp_queue_len_bytes = 0; | 718 | neigh->arp_queue_len_bytes = 0; |
712 | 719 | ||
720 | if (dev->netdev_ops->ndo_neigh_destroy) | ||
721 | dev->netdev_ops->ndo_neigh_destroy(neigh); | ||
722 | |||
713 | dev_put(dev); | 723 | dev_put(dev); |
714 | neigh_parms_put(neigh->parms); | 724 | neigh_parms_put(neigh->parms); |
715 | 725 | ||