mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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:
parent
c3a2e83705
commit
63fca65d08
7 changed files with 96 additions and 0 deletions
|
@ -35,6 +35,22 @@ static inline struct neighbour *__ipv4_neigh_lookup(struct net_device *dev, u32
|
|||
return n;
|
||||
}
|
||||
|
||||
static inline void __ipv4_confirm_neigh(struct net_device *dev, u32 key)
|
||||
{
|
||||
struct neighbour *n;
|
||||
|
||||
rcu_read_lock_bh();
|
||||
n = __ipv4_neigh_lookup_noref(dev, key);
|
||||
if (n) {
|
||||
unsigned long now = jiffies;
|
||||
|
||||
/* avoid dirtying neighbour */
|
||||
if (n->confirmed != now)
|
||||
n->confirmed = now;
|
||||
}
|
||||
rcu_read_unlock_bh();
|
||||
}
|
||||
|
||||
void arp_init(void);
|
||||
int arp_ioctl(struct net *net, unsigned int cmd, void __user *arg);
|
||||
void arp_send(int type, int ptype, __be32 dest_ip,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue