diff options
Diffstat (limited to 'net/ipv4/tcp_input.c')
| -rw-r--r-- | net/ipv4/tcp_input.c | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index eba873e9b560..cad73b7dfef0 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
| @@ -4541,49 +4541,6 @@ static void tcp_urg(struct sock *sk, struct sk_buff *skb, struct tcphdr *th) | |||
| 4541 | } | 4541 | } |
| 4542 | } | 4542 | } |
| 4543 | 4543 | ||
| 4544 | static int tcp_defer_accept_check(struct sock *sk) | ||
| 4545 | { | ||
| 4546 | struct tcp_sock *tp = tcp_sk(sk); | ||
| 4547 | |||
| 4548 | if (tp->defer_tcp_accept.request) { | ||
| 4549 | int queued_data = tp->rcv_nxt - tp->copied_seq; | ||
| 4550 | int hasfin = !skb_queue_empty(&sk->sk_receive_queue) ? | ||
| 4551 | tcp_hdr((struct sk_buff *) | ||
| 4552 | sk->sk_receive_queue.prev)->fin : 0; | ||
| 4553 | |||
| 4554 | if (queued_data && hasfin) | ||
| 4555 | queued_data--; | ||
| 4556 | |||
| 4557 | if (queued_data && | ||
| 4558 | tp->defer_tcp_accept.listen_sk->sk_state == TCP_LISTEN) { | ||
| 4559 | if (sock_flag(sk, SOCK_KEEPOPEN)) { | ||
| 4560 | inet_csk_reset_keepalive_timer(sk, | ||
| 4561 | keepalive_time_when(tp)); | ||
| 4562 | } else { | ||
| 4563 | inet_csk_delete_keepalive_timer(sk); | ||
| 4564 | } | ||
| 4565 | |||
| 4566 | inet_csk_reqsk_queue_add( | ||
| 4567 | tp->defer_tcp_accept.listen_sk, | ||
| 4568 | tp->defer_tcp_accept.request, | ||
| 4569 | sk); | ||
| 4570 | |||
| 4571 | tp->defer_tcp_accept.listen_sk->sk_data_ready( | ||
| 4572 | tp->defer_tcp_accept.listen_sk, 0); | ||
| 4573 | |||
| 4574 | sock_put(tp->defer_tcp_accept.listen_sk); | ||
| 4575 | sock_put(sk); | ||
| 4576 | tp->defer_tcp_accept.listen_sk = NULL; | ||
| 4577 | tp->defer_tcp_accept.request = NULL; | ||
| 4578 | } else if (hasfin || | ||
| 4579 | tp->defer_tcp_accept.listen_sk->sk_state != TCP_LISTEN) { | ||
| 4580 | tcp_reset(sk); | ||
| 4581 | return -1; | ||
| 4582 | } | ||
| 4583 | } | ||
| 4584 | return 0; | ||
| 4585 | } | ||
| 4586 | |||
| 4587 | static int tcp_copy_to_iovec(struct sock *sk, struct sk_buff *skb, int hlen) | 4544 | static int tcp_copy_to_iovec(struct sock *sk, struct sk_buff *skb, int hlen) |
| 4588 | { | 4545 | { |
| 4589 | struct tcp_sock *tp = tcp_sk(sk); | 4546 | struct tcp_sock *tp = tcp_sk(sk); |
| @@ -4944,8 +4901,6 @@ step5: | |||
| 4944 | 4901 | ||
| 4945 | tcp_data_snd_check(sk); | 4902 | tcp_data_snd_check(sk); |
| 4946 | tcp_ack_snd_check(sk); | 4903 | tcp_ack_snd_check(sk); |
| 4947 | |||
| 4948 | tcp_defer_accept_check(sk); | ||
| 4949 | return 0; | 4904 | return 0; |
| 4950 | 4905 | ||
| 4951 | csum_error: | 4906 | csum_error: |
