summaryrefslogtreecommitdiff
path: root/net/core
diff options
context:
space:
mode:
authorJulian Anastasov <ja@ssi.bg>2017-02-07 00:14:11 +0300
committerDavid S. Miller <davem@davemloft.net>2017-02-07 21:07:46 +0300
commit9b8805a325591cf5b6b9df71200de25a2bd721fd (patch)
tree42ccaa80b5485acf92cfc8ce879aca219c31f1ff /net/core
parentb08d46b01e995dd7b653b22d35bd1d958d6ee9b4 (diff)
downloadlinux-9b8805a325591cf5b6b9df71200de25a2bd721fd.tar.xz
sock: add sk_dst_pending_confirm flag
Add new sock flag to allow sockets to confirm neighbour. When same struct dst_entry can be used for many different neighbours we can not use it for pending confirmations. As not all call paths lock the socket use full word for the flag. Add sk_dst_confirm as replacement for dst_confirm when called for received packets. Signed-off-by: Julian Anastasov <ja@ssi.bg> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/sock.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/core/sock.c b/net/core/sock.c
index 8b35debfe454..b74356535559 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -502,6 +502,7 @@ struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie)
if (dst && dst->obsolete && dst->ops->check(dst, cookie) == NULL) {
sk_tx_queue_clear(sk);
+ sk->sk_dst_pending_confirm = 0;
RCU_INIT_POINTER(sk->sk_dst_cache, NULL);
dst_release(dst);
return NULL;
@@ -1519,6 +1520,7 @@ struct sock *sk_clone_lock(const struct sock *sk, const gfp_t priority)
af_family_clock_key_strings[newsk->sk_family]);
newsk->sk_dst_cache = NULL;
+ newsk->sk_dst_pending_confirm = 0;
newsk->sk_wmem_queued = 0;
newsk->sk_forward_alloc = 0;
atomic_set(&newsk->sk_drops, 0);