]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - include/net/sock.h
net: add dst_pending_confirm flag to skbuff
[mirror_ubuntu-zesty-kernel.git] / include / net / sock.h
index 7e4ca83a6815a740c231212baddcd7743e9fcd33..dfe020eea2ae64dc1275d0bbde984474a5234056 100644 (file)
@@ -1818,6 +1818,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)