OSDN Git Service

tcp: move app_limited init to tcp_disconnect()
authorEric Dumazet <edumazet@google.com>
Thu, 17 Jan 2019 19:23:40 +0000 (11:23 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 18 Jan 2019 06:19:05 +0000 (22:19 -0800)
If we make sure all listeners have app_limited set to ~0U,
then a clone will also inherit proper initial value.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp.c
net/ipv4/tcp_minisocks.c

index 551ad86..5f15fcc 100644 (file)
@@ -2609,6 +2609,9 @@ int tcp_disconnect(struct sock *sk, int flags)
        tp->sacked_out = 0;
        tp->tlp_high_seq = 0;
        tp->last_oow_ack_time = 0;
+       /* There's a bubble in the pipe until at least the first ACK. */
+       tp->app_limited = ~0U;
+
 
        /* Clean up fastopen related fields */
        tcp_free_fastopen_req(tp);
index 29fba13..13f3c64 100644 (file)
@@ -486,9 +486,6 @@ struct sock *tcp_create_openreq_child(const struct sock *sk,
        newsk->sk_txhash = treq->txhash;
        newtp->total_retrans = req->num_retrans;
 
-       /* There's a bubble in the pipe until at least the first ACK. */
-       newtp->app_limited = ~0U;
-
        tcp_init_xmit_timers(newsk);
        newtp->write_seq = newtp->pushed_seq = treq->snt_isn + 1;