mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-24 13:44:26 -04:00
net: add dst_pending_confirm flag to skbuff
Add new skbuff flag to allow protocols to confirm neighbour. When same struct dst_entry can be used for many different neighbours we can not use it for pending confirmations. Add sock_confirm_neigh() helper to confirm the neighbour and use it for IPv4, IPv6 and VRF before dst_neigh_output. Signed-off-by: Julian Anastasov <ja@ssi.bg> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
9b8805a325
commit
4ff0620354
5 changed files with 35 additions and 2 deletions
|
|
@ -1821,6 +1821,20 @@ static inline void sk_dst_confirm(struct sock *sk)
|
|||
sk->sk_dst_pending_confirm = 1;
|
||||
}
|
||||
|
||||
static inline void sock_confirm_neigh(struct sk_buff *skb, struct neighbour *n)
|
||||
{
|
||||
if (skb_get_dst_pending_confirm(skb)) {
|
||||
struct sock *sk = skb->sk;
|
||||
unsigned long now = jiffies;
|
||||
|
||||
/* avoid dirtying neighbour */
|
||||
if (n->confirmed != now)
|
||||
n->confirmed = now;
|
||||
if (sk && sk->sk_dst_pending_confirm)
|
||||
sk->sk_dst_pending_confirm = 0;
|
||||
}
|
||||
}
|
||||
|
||||
bool sk_mc_loop(struct sock *sk);
|
||||
|
||||
static inline bool sk_can_gso(const struct sock *sk)
|
||||
|
|
|
|||
Loading…
Reference in a new issue