Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 279012
b: refs/heads/master
c: 447f219
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Dec 19, 2011
1 parent 6d1eed8 commit 13fed0d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 72be84f1c21c0ddba1081291072d7acc9ccddf5f
refs/heads/master: 447f219190bf0368b8b36cf60155744cb43510df
1 change: 1 addition & 0 deletions trunk/include/linux/netdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -974,6 +974,7 @@ struct net_device_ops {
int (*ndo_set_features)(struct net_device *dev,
netdev_features_t features);
int (*ndo_neigh_construct)(struct neighbour *n);
void (*ndo_neigh_destroy)(struct neighbour *n);
};

/*
Expand Down
1 change: 1 addition & 0 deletions trunk/include/net/neighbour.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ struct neigh_parms {
#endif
struct net_device *dev;
struct neigh_parms *next;
int (*neigh_setup)(struct neighbour *);
void (*neigh_cleanup)(struct neighbour *);
struct neigh_table *tbl;

Expand Down
10 changes: 10 additions & 0 deletions trunk/net/core/neighbour.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

write_lock_bh(&tbl->lock);
Expand Down Expand Up @@ -710,6 +717,9 @@ void neigh_destroy(struct neighbour *neigh)
skb_queue_purge(&neigh->arp_queue);
neigh->arp_queue_len_bytes = 0;

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

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

Expand Down

0 comments on commit 13fed0d

Please sign in to comment.