net: add confirm_neigh method to dst_ops
Add confirm_neigh method to dst_ops and use it from IPv4 and IPv6 to lookup and confirm the neighbour. Its usage via the new helper dst_confirm_neigh() should be restricted to MSG_PROBE users for performance reasons. For XFRM prefer the last tunnel address, if present. With help from Steffen Klassert. Signed-off-by: Julian Anastasov <ja@ssi.bg> Acked-by: Steffen Klassert <steffen.klassert@secunet.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
c3a2e83705
commit
63fca65d08
@@ -391,6 +391,23 @@ static inline struct neighbour *__ipv6_neigh_lookup(struct net_device *dev, cons
|
||||
return n;
|
||||
}
|
||||
|
||||
static inline void __ipv6_confirm_neigh(struct net_device *dev,
|
||||
const void *pkey)
|
||||
{
|
||||
struct neighbour *n;
|
||||
|
||||
rcu_read_lock_bh();
|
||||
n = __ipv6_neigh_lookup_noref(dev, pkey);
|
||||
if (n) {
|
||||
unsigned long now = jiffies;
|
||||
|
||||
/* avoid dirtying neighbour */
|
||||
if (n->confirmed != now)
|
||||
n->confirmed = now;
|
||||
}
|
||||
rcu_read_unlock_bh();
|
||||
}
|
||||
|
||||
int ndisc_init(void);
|
||||
int ndisc_late_init(void);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user