Commit 6bcdc40d authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

tcp: move rx_opt & syn_data_acked init to tcp_disconnect()

If we make sure all listeners have these fields cleared, then a clone
will also inherit zero values.
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 792c4354
...@@ -2617,6 +2617,10 @@ int tcp_disconnect(struct sock *sk, int flags) ...@@ -2617,6 +2617,10 @@ int tcp_disconnect(struct sock *sk, int flags)
tp->rack.last_delivered = 0; tp->rack.last_delivered = 0;
tp->rack.reo_wnd_persist = 0; tp->rack.reo_wnd_persist = 0;
tp->rack.dsack_seen = 0; tp->rack.dsack_seen = 0;
tp->syn_data_acked = 0;
tp->rx_opt.saw_tstamp = 0;
tp->rx_opt.dsack = 0;
tp->rx_opt.num_sacks = 0;
/* Clean up fastopen related fields */ /* Clean up fastopen related fields */
......
...@@ -489,11 +489,6 @@ struct sock *tcp_create_openreq_child(const struct sock *sk, ...@@ -489,11 +489,6 @@ struct sock *tcp_create_openreq_child(const struct sock *sk,
tcp_init_xmit_timers(newsk); tcp_init_xmit_timers(newsk);
newtp->write_seq = newtp->pushed_seq = treq->snt_isn + 1; newtp->write_seq = newtp->pushed_seq = treq->snt_isn + 1;
newtp->rx_opt.saw_tstamp = 0;
newtp->rx_opt.dsack = 0;
newtp->rx_opt.num_sacks = 0;
if (sock_flag(newsk, SOCK_KEEPOPEN)) if (sock_flag(newsk, SOCK_KEEPOPEN))
inet_csk_reset_keepalive_timer(newsk, inet_csk_reset_keepalive_timer(newsk,
keepalive_time_when(newtp)); keepalive_time_when(newtp));
...@@ -534,7 +529,6 @@ struct sock *tcp_create_openreq_child(const struct sock *sk, ...@@ -534,7 +529,6 @@ struct sock *tcp_create_openreq_child(const struct sock *sk,
tcp_ecn_openreq_child(newtp, req); tcp_ecn_openreq_child(newtp, req);
newtp->fastopen_req = NULL; newtp->fastopen_req = NULL;
newtp->fastopen_rsk = NULL; newtp->fastopen_rsk = NULL;
newtp->syn_data_acked = 0;
__TCP_INC_STATS(sock_net(sk), TCP_MIB_PASSIVEOPENS); __TCP_INC_STATS(sock_net(sk), TCP_MIB_PASSIVEOPENS);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment