diff options
author | Eric Dumazet <edumazet@google.com> | 2015-03-17 21:32:29 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-17 22:01:56 -0400 |
commit | 9439ce00f208d95703a6725e4ea986dd90e37ffd (patch) | |
tree | 734c4448ed923710ea05b3729bcdb3a6c09db46e /net/ipv4 | |
parent | 4e9a578e5b6bdfa8b7fed7a41f28a86a7cffc85f (diff) |
tcp: rename struct tcp_request_sock listener
The listener field in struct tcp_request_sock is a pointer
back to the listener. We now have req->rsk_listener, so TCP
only needs one boolean and not a full pointer.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/inet_connection_sock.c | 7 | ||||
-rw-r--r-- | net/ipv4/syncookies.c | 2 | ||||
-rw-r--r-- | net/ipv4/tcp_fastopen.c | 7 | ||||
-rw-r--r-- | net/ipv4/tcp_input.c | 2 |
4 files changed, 6 insertions, 12 deletions
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c index 3390ba6f96b2..741f0d96a7f7 100644 --- a/net/ipv4/inet_connection_sock.c +++ b/net/ipv4/inet_connection_sock.c | |||
@@ -325,7 +325,7 @@ struct sock *inet_csk_accept(struct sock *sk, int flags, int *err) | |||
325 | sk_acceptq_removed(sk); | 325 | sk_acceptq_removed(sk); |
326 | if (sk->sk_protocol == IPPROTO_TCP && queue->fastopenq != NULL) { | 326 | if (sk->sk_protocol == IPPROTO_TCP && queue->fastopenq != NULL) { |
327 | spin_lock_bh(&queue->fastopenq->lock); | 327 | spin_lock_bh(&queue->fastopenq->lock); |
328 | if (tcp_rsk(req)->listener) { | 328 | if (tcp_rsk(req)->tfo_listener) { |
329 | /* We are still waiting for the final ACK from 3WHS | 329 | /* We are still waiting for the final ACK from 3WHS |
330 | * so can't free req now. Instead, we set req->sk to | 330 | * so can't free req now. Instead, we set req->sk to |
331 | * NULL to signify that the child socket is taken | 331 | * NULL to signify that the child socket is taken |
@@ -817,9 +817,9 @@ void inet_csk_listen_stop(struct sock *sk) | |||
817 | 817 | ||
818 | percpu_counter_inc(sk->sk_prot->orphan_count); | 818 | percpu_counter_inc(sk->sk_prot->orphan_count); |
819 | 819 | ||
820 | if (sk->sk_protocol == IPPROTO_TCP && tcp_rsk(req)->listener) { | 820 | if (sk->sk_protocol == IPPROTO_TCP && tcp_rsk(req)->tfo_listener) { |
821 | BUG_ON(tcp_sk(child)->fastopen_rsk != req); | 821 | BUG_ON(tcp_sk(child)->fastopen_rsk != req); |
822 | BUG_ON(sk != tcp_rsk(req)->listener); | 822 | BUG_ON(sk != req->rsk_listener); |
823 | 823 | ||
824 | /* Paranoid, to prevent race condition if | 824 | /* Paranoid, to prevent race condition if |
825 | * an inbound pkt destined for child is | 825 | * an inbound pkt destined for child is |
@@ -828,7 +828,6 @@ void inet_csk_listen_stop(struct sock *sk) | |||
828 | * tcp_v4_destroy_sock(). | 828 | * tcp_v4_destroy_sock(). |
829 | */ | 829 | */ |
830 | tcp_sk(child)->fastopen_rsk = NULL; | 830 | tcp_sk(child)->fastopen_rsk = NULL; |
831 | sock_put(sk); | ||
832 | } | 831 | } |
833 | inet_csk_destroy_sock(child); | 832 | inet_csk_destroy_sock(child); |
834 | 833 | ||
diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c index eb940750bb1b..574b67765a06 100644 --- a/net/ipv4/syncookies.c +++ b/net/ipv4/syncookies.c | |||
@@ -345,7 +345,7 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb) | |||
345 | ireq->tstamp_ok = tcp_opt.saw_tstamp; | 345 | ireq->tstamp_ok = tcp_opt.saw_tstamp; |
346 | req->ts_recent = tcp_opt.saw_tstamp ? tcp_opt.rcv_tsval : 0; | 346 | req->ts_recent = tcp_opt.saw_tstamp ? tcp_opt.rcv_tsval : 0; |
347 | treq->snt_synack = tcp_opt.saw_tstamp ? tcp_opt.rcv_tsecr : 0; | 347 | treq->snt_synack = tcp_opt.saw_tstamp ? tcp_opt.rcv_tsecr : 0; |
348 | treq->listener = NULL; | 348 | treq->tfo_listener = false; |
349 | ireq->ireq_family = AF_INET; | 349 | ireq->ireq_family = AF_INET; |
350 | 350 | ||
351 | ireq->ir_iif = sk->sk_bound_dev_if; | 351 | ireq->ir_iif = sk->sk_bound_dev_if; |
diff --git a/net/ipv4/tcp_fastopen.c b/net/ipv4/tcp_fastopen.c index 84381319e1bc..186fd394ec0a 100644 --- a/net/ipv4/tcp_fastopen.c +++ b/net/ipv4/tcp_fastopen.c | |||
@@ -155,12 +155,7 @@ static bool tcp_fastopen_create_child(struct sock *sk, | |||
155 | tp = tcp_sk(child); | 155 | tp = tcp_sk(child); |
156 | 156 | ||
157 | tp->fastopen_rsk = req; | 157 | tp->fastopen_rsk = req; |
158 | /* Do a hold on the listner sk so that if the listener is being | 158 | tcp_rsk(req)->tfo_listener = true; |
159 | * closed, the child that has been accepted can live on and still | ||
160 | * access listen_lock. | ||
161 | */ | ||
162 | sock_hold(sk); | ||
163 | tcp_rsk(req)->listener = sk; | ||
164 | 159 | ||
165 | /* RFC1323: The window in SYN & SYN/ACK segments is never | 160 | /* RFC1323: The window in SYN & SYN/ACK segments is never |
166 | * scaled. So correct it appropriately. | 161 | * scaled. So correct it appropriately. |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index fbe518981d36..a94ddb96fc85 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -6120,7 +6120,7 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops, | |||
6120 | if (err || want_cookie) | 6120 | if (err || want_cookie) |
6121 | goto drop_and_free; | 6121 | goto drop_and_free; |
6122 | 6122 | ||
6123 | tcp_rsk(req)->listener = NULL; | 6123 | tcp_rsk(req)->tfo_listener = false; |
6124 | af_ops->queue_hash_add(sk, req, TCP_TIMEOUT_INIT); | 6124 | af_ops->queue_hash_add(sk, req, TCP_TIMEOUT_INIT); |
6125 | } | 6125 | } |
6126 | 6126 | ||