Skip to content

Commit

Permalink
tcp: move tp->rack init to tcp_disconnect()
Browse files Browse the repository at this point in the history
If we make sure all listeners have proper tp->rack value,
then a clone will also inherit proper initial value.

Note that fresh sockets init tp->rack from tcp_init_sock()

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Jan 18, 2019
1 parent 6cda8b7 commit 792c435
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 6 additions & 0 deletions net/ipv4/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2611,6 +2611,12 @@ int tcp_disconnect(struct sock *sk, int flags)
tp->last_oow_ack_time = 0;
/* There's a bubble in the pipe until at least the first ACK. */
tp->app_limited = ~0U;
tp->rack.mstamp = 0;
tp->rack.advanced = 0;
tp->rack.reo_wnd_steps = 1;
tp->rack.last_delivered = 0;
tp->rack.reo_wnd_persist = 0;
tp->rack.dsack_seen = 0;


/* Clean up fastopen related fields */
Expand Down
6 changes: 0 additions & 6 deletions net/ipv4/tcp_minisocks.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,12 +535,6 @@ struct sock *tcp_create_openreq_child(const struct sock *sk,
newtp->fastopen_req = NULL;
newtp->fastopen_rsk = NULL;
newtp->syn_data_acked = 0;
newtp->rack.mstamp = 0;
newtp->rack.advanced = 0;
newtp->rack.reo_wnd_steps = 1;
newtp->rack.last_delivered = 0;
newtp->rack.reo_wnd_persist = 0;
newtp->rack.dsack_seen = 0;

__TCP_INC_STATS(sock_net(sk), TCP_MIB_PASSIVEOPENS);

Expand Down

0 comments on commit 792c435

Please sign in to comment.