Skip to content

Commit 447f219

Browse files
committed
Revert "net: Remove unused neighbour layer ops."
This reverts commit 5c3ddec. 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>
1 parent 72be84f commit 447f219

3 files changed

Lines changed: 12 additions & 0 deletions

File tree

‎include/linux/netdevice.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -974,6 +974,7 @@ struct net_device_ops {
974974
int (*ndo_set_features)(struct net_device *dev,
975975
netdev_features_t features);
976976
int (*ndo_neigh_construct)(struct neighbour *n);
977+
void (*ndo_neigh_destroy)(struct neighbour *n);
977978
};
978979

979980
/*

‎include/net/neighbour.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ struct neigh_parms {
4343
#endif
4444
struct net_device *dev;
4545
struct neigh_parms *next;
46+
int (*neigh_setup)(struct neighbour *);
4647
void (*neigh_cleanup)(struct neighbour *);
4748
struct neigh_table *tbl;
4849

‎net/core/neighbour.c‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,13 @@ struct neighbour *neigh_create(struct neigh_table *tbl, const void *pkey,
497497
}
498498
}
499499

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+
500507
n->confirmed = jiffies - (n->parms->base_reachable_time << 1);
501508

502509
write_lock_bh(&tbl->lock);
@@ -710,6 +717,9 @@ void neigh_destroy(struct neighbour *neigh)
710717
skb_queue_purge(&neigh->arp_queue);
711718
neigh->arp_queue_len_bytes = 0;
712719

720+
if (dev->netdev_ops->ndo_neigh_destroy)
721+
dev->netdev_ops->ndo_neigh_destroy(neigh);
722+
713723
dev_put(dev);
714724
neigh_parms_put(neigh->parms);
715725

0 commit comments

Comments
 (0)