Commit 447f2191 authored by David S. Miller's avatar David S. Miller

Revert "net: Remove unused neighbour layer ops."

This reverts commit 5c3ddec7.

S390 qeth driver actually still uses the setup ops.
Reported-by: default avatarFrank Blaschka <blaschka@linux.vnet.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 72be84f1
...@@ -974,6 +974,7 @@ struct net_device_ops { ...@@ -974,6 +974,7 @@ struct net_device_ops {
int (*ndo_set_features)(struct net_device *dev, int (*ndo_set_features)(struct net_device *dev,
netdev_features_t features); netdev_features_t features);
int (*ndo_neigh_construct)(struct neighbour *n); int (*ndo_neigh_construct)(struct neighbour *n);
void (*ndo_neigh_destroy)(struct neighbour *n);
}; };
/* /*
......
...@@ -43,6 +43,7 @@ struct neigh_parms { ...@@ -43,6 +43,7 @@ struct neigh_parms {
#endif #endif
struct net_device *dev; struct net_device *dev;
struct neigh_parms *next; struct neigh_parms *next;
int (*neigh_setup)(struct neighbour *);
void (*neigh_cleanup)(struct neighbour *); void (*neigh_cleanup)(struct neighbour *);
struct neigh_table *tbl; struct neigh_table *tbl;
......
...@@ -497,6 +497,13 @@ struct neighbour *neigh_create(struct neigh_table *tbl, const void *pkey, ...@@ -497,6 +497,13 @@ struct neighbour *neigh_create(struct neigh_table *tbl, const void *pkey,
} }
} }
/* Device specific setup. */
if (n->parms->neigh_setup &&
(error = n->parms->neigh_setup(n)) < 0) {
rc = ERR_PTR(error);
goto out_neigh_release;
}
n->confirmed = jiffies - (n->parms->base_reachable_time << 1); n->confirmed = jiffies - (n->parms->base_reachable_time << 1);
write_lock_bh(&tbl->lock); write_lock_bh(&tbl->lock);
...@@ -710,6 +717,9 @@ void neigh_destroy(struct neighbour *neigh) ...@@ -710,6 +717,9 @@ void neigh_destroy(struct neighbour *neigh)
skb_queue_purge(&neigh->arp_queue); skb_queue_purge(&neigh->arp_queue);
neigh->arp_queue_len_bytes = 0; neigh->arp_queue_len_bytes = 0;
if (dev->netdev_ops->ndo_neigh_destroy)
dev->netdev_ops->ndo_neigh_destroy(neigh);
dev_put(dev); dev_put(dev);
neigh_parms_put(neigh->parms); neigh_parms_put(neigh->parms);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment