Skip to contentSkip to conversation

tcp: clear tp->delivered in tcp_disconnect()

PATCH In review Eric Dumazet 4 participants 4 messages Jan 31, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tcp: clear tp->delivered in tcp_disconnect()

tp->delivered needs to be cleared in tcp_disconnect().

tcp_disconnect() is rarely used, but it is worth fixing it.

Fixes ddf1af6fa00e ("tcp: new delivery accounting")
Cc Yuchung Cheng <[email protected]>
Cc Neal Cardwell <[email protected]>
---
 net/ipv4/tcp.c | 1 +
 1 file changed, 1 insertion(+)
net/ipv4/tcp.c +1 -0
index dd57f1e3618160c1e51d6ff54afa984292614e5c..a8ffdfb61f422228d4af1de600b756c9d3894ef5 100644
@@ -2622,6 +2622,7 @@ int tcp_disconnect(struct sock *sk, int flags)
 	tp->snd_cwnd = TCP_INIT_CWND;
 	tp->snd_cwnd_cnt = 0;
 	tp->window_clamp = 0;
+	tp->delivered = 0;
 	tp->delivered_ce = 0;
 	tcp_set_ca_state(sk, TCP_CA_Open);
 	tp->is_sack_reneg = 0;
Signature · 1 line
2.25.0.341.g760bfbb309-goog
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Eric Dumazet

tp->delivered needs to be cleared in tcp_disconnect().

tcp_disconnect() is rarely used, but it is worth fixing it.

Fixes ddf1af6fa00e ("tcp: new delivery accounting")
Cc Yuchung Cheng <[email protected]>

thanks Eric

Quoted 20 lines
Cc Neal Cardwell <[email protected]>
---
 net/ipv4/tcp.c | 1 +
 1 file changed, 1 insertion(+)
net/ipv4/tcp.c +1 -1
index dd57f1e3618160c1e51d6ff54afa984292614e5c..a8ffdfb61f422228d4af1de600b756c9d3894ef5 100644
@@ -2622,6 +2622,7 @@ int tcp_disconnect(struct sock *sk, int flags)
        tp->snd_cwnd = TCP_INIT_CWND;
        tp->snd_cwnd_cnt = 0;
        tp->window_clamp = 0;
+       tp->delivered = 0;
        tp->delivered_ce = 0;
        tcp_set_ca_state(sk, TCP_CA_Open);
        tp->is_sack_reneg = 0;
--

2.25.0.341.g760bfbb309-goog

maintainer Acked-by on v1 1/1
#2 lore raw
In reply to Eric Dumazet
Quoted 18 lines · Eric Dumazet

tp->delivered needs to be cleared in tcp_disconnect().

tcp_disconnect() is rarely used, but it is worth fixing it.

Fixes ddf1af6fa00e ("tcp: new delivery accounting")
Cc Yuchung Cheng <[email protected]>
Cc Neal Cardwell <[email protected]>
---
 net/ipv4/tcp.c | 1 +
 1 file changed, 1 insertion(+)
net/ipv4/tcp.c +0 -0
index dd57f1e3618160c1e51d6ff54afa984292614e5c..a8ffdfb61f422228d4af1de600b756c9d3894ef5 100644

net/ipv4/tcp.c int tcp_disconnect(struct sock *sk, int flags)

Quoted 8 lines
net/ipv4/tcp.c +1 -1
@@ -2622,6 +2622,7 @@ int tcp_disconnect(struct sock *sk, int flags)
        tp->snd_cwnd = TCP_INIT_CWND;
        tp->snd_cwnd_cnt = 0;
        tp->window_clamp = 0;
+       tp->delivered = 0;
        tp->delivered_ce = 0;
        tcp_set_ca_state(sk, TCP_CA_Open);
        tp->is_sack_reneg = 0;
--

Thanks, Eric!

neal

#3 lore raw
Quoted 31 lines · Neal Cardwell
Quoted 18 lines · Eric Dumazet

tp->delivered needs to be cleared in tcp_disconnect().

tcp_disconnect() is rarely used, but it is worth fixing it.

Fixes ddf1af6fa00e ("tcp: new delivery accounting")
Cc Yuchung Cheng <[email protected]>
Cc Neal Cardwell <[email protected]>
---
 net/ipv4/tcp.c | 1 +
 1 file changed, 1 insertion(+)
net/ipv4/tcp.c +0 -0
index dd57f1e3618160c1e51d6ff54afa984292614e5c..a8ffdfb61f422228d4af1de600b756c9d3894ef5 100644

net/ipv4/tcp.c int tcp_disconnect(struct sock *sk, int flags)

Quoted 8 lines
net/ipv4/tcp.c +1 -1
@@ -2622,6 +2622,7 @@ int tcp_disconnect(struct sock *sk, int flags)
        tp->snd_cwnd = TCP_INIT_CWND;
        tp->snd_cwnd_cnt = 0;
        tp->window_clamp = 0;
+       tp->delivered = 0;
        tp->delivered_ce = 0;
        tcp_set_ca_state(sk, TCP_CA_Open);
        tp->is_sack_reneg = 0;
--

Thanks, Eric!

Quoted 3 lines

neal

Nice catch! Thanks!