From fc232ee8c35c22c0911d24e45e3c54fc91ae7cb0 Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Thu, 6 Sep 2012 08:07:13 +0000 Subject: [PATCH] --- yaml --- r: 327822 b: refs/heads/master c: 7ab4551f3b391818e29263279031dca1e26417c6 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/net/ipv4/af_inet.c | 7 ++----- trunk/net/ipv4/inet_connection_sock.c | 4 ++-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 2b36555a7da1..75a27b94b9da 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ef2c7d7b59708d54213c7556a82d14de9a7e4475 +refs/heads/master: 7ab4551f3b391818e29263279031dca1e26417c6 diff --git a/trunk/net/ipv4/af_inet.c b/trunk/net/ipv4/af_inet.c index 4f70ef0b946d..845372b025f6 100644 --- a/trunk/net/ipv4/af_inet.c +++ b/trunk/net/ipv4/af_inet.c @@ -149,11 +149,8 @@ void inet_sock_destruct(struct sock *sk) pr_err("Attempt to release alive inet socket %p\n", sk); return; } - if (sk->sk_type == SOCK_STREAM) { - struct fastopen_queue *fastopenq = - inet_csk(sk)->icsk_accept_queue.fastopenq; - kfree(fastopenq); - } + if (sk->sk_protocol == IPPROTO_TCP) + kfree(inet_csk(sk)->icsk_accept_queue.fastopenq); WARN_ON(atomic_read(&sk->sk_rmem_alloc)); WARN_ON(atomic_read(&sk->sk_wmem_alloc)); diff --git a/trunk/net/ipv4/inet_connection_sock.c b/trunk/net/ipv4/inet_connection_sock.c index 8464b79c493f..f0c5b9c1a957 100644 --- a/trunk/net/ipv4/inet_connection_sock.c +++ b/trunk/net/ipv4/inet_connection_sock.c @@ -314,7 +314,7 @@ struct sock *inet_csk_accept(struct sock *sk, int flags, int *err) newsk = req->sk; sk_acceptq_removed(sk); - if (sk->sk_type == SOCK_STREAM && queue->fastopenq != NULL) { + if (sk->sk_protocol == IPPROTO_TCP && queue->fastopenq != NULL) { spin_lock_bh(&queue->fastopenq->lock); if (tcp_rsk(req)->listener) { /* We are still waiting for the final ACK from 3WHS @@ -775,7 +775,7 @@ void inet_csk_listen_stop(struct sock *sk) percpu_counter_inc(sk->sk_prot->orphan_count); - if (sk->sk_type == SOCK_STREAM && tcp_rsk(req)->listener) { + if (sk->sk_protocol == IPPROTO_TCP && tcp_rsk(req)->listener) { BUG_ON(tcp_sk(child)->fastopen_rsk != req); BUG_ON(sk != tcp_rsk(req)->listener);