Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 278302
b: refs/heads/master
c: da6a8fa
h: refs/heads/master
v: v3
  • Loading branch information
David Miller committed Nov 30, 2011
1 parent cc97046 commit 9d488d5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 869759b9e4160fb8a8d25bc3b4ce3b658523aebb
refs/heads/master: da6a8fa0275e2178c44a875374cae80d057538d1
2 changes: 2 additions & 0 deletions trunk/include/linux/netdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -974,6 +974,8 @@ struct net_device_ops {
netdev_features_t features);
int (*ndo_set_features)(struct net_device *dev,
netdev_features_t features);
int (*ndo_neigh_construct)(struct neighbour *n);
int (*ndo_neigh_destroy)(struct neighbour *n);
};

/*
Expand Down
15 changes: 14 additions & 1 deletion trunk/net/core/neighbour.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,14 @@ struct neighbour *neigh_create(struct neigh_table *tbl, const void *pkey,
goto out_neigh_release;
}

if (dev->netdev_ops->ndo_neigh_construct) {
error = dev->netdev_ops->ndo_neigh_construct(n);
if (error < 0) {
rc = ERR_PTR(error);
goto out_neigh_release;
}
}

/* Device specific setup. */
if (n->parms->neigh_setup &&
(error = n->parms->neigh_setup(n)) < 0) {
Expand Down Expand Up @@ -692,6 +700,8 @@ static inline void neigh_parms_put(struct neigh_parms *parms)
*/
void neigh_destroy(struct neighbour *neigh)
{
struct net_device *dev = neigh->dev;

NEIGH_CACHE_STAT_INC(neigh->tbl, destroys);

if (!neigh->dead) {
Expand All @@ -707,7 +717,10 @@ void neigh_destroy(struct neighbour *neigh)
skb_queue_purge(&neigh->arp_queue);
neigh->arp_queue_len_bytes = 0;

dev_put(neigh->dev);
if (dev->netdev_ops->ndo_neigh_destroy)
dev->netdev_ops->ndo_neigh_destroy(neigh);

dev_put(dev);
neigh_parms_put(neigh->parms);

NEIGH_PRINTK2("neigh %p is destroyed.\n", neigh);
Expand Down

0 comments on commit 9d488d5

Please sign in to comment.