From: Stefan Baranoff <hidden> Date: 2018-07-15 15:36:47
Correct previous bad attempt at allowing sockets to come out of TCP
repair without sending window probes. To avoid changing size of
the repair variable in struct tcp_sock, this lets the decision for
sending probes or not to be made when coming out of repair by
introducing two ways to turn it off.
v2:
* Remove erroneous comment; defines now make behavior clear
Fixes: 70b7ff130224 ("tcp: allow user to create repair socket without window probes")
Signed-off-by: Stefan Baranoff <redacted>
---
include/uapi/linux/tcp.h | 4 ++++
net/ipv4/tcp.c | 13 +++++++------
2 files changed, 11 insertions(+), 6 deletions(-)
@@ -2823,16 +2823,17 @@ static int do_tcp_setsockopt(struct sock *sk, int level,caseTCP_REPAIR:if(!tcp_can_repair_sock(sk))err=-EPERM;-/* 1 for normal repair, 2 for no window probes */-elseif(val==1||val==2){-tp->repair=val;+elseif(val==TCP_REPAIR_ON){+tp->repair=1;sk->sk_reuse=SK_FORCE_REUSE;tp->repair_queue=TCP_NO_QUEUE;-}elseif(val==0){+}elseif(val==TCP_REPAIR_OFF){+tp->repair=0;+sk->sk_reuse=SK_NO_REUSE;+tcp_send_window_probe(sk);+}elseif(val==TCP_REPAIR_OFF_NO_WP){tp->repair=0;sk->sk_reuse=SK_NO_REUSE;-if(tp->repair==1)-tcp_send_window_probe(sk);}elseerr=-EINVAL;
From: Eric Dumazet <hidden> Date: 2018-07-16 14:44:24
On 07/15/2018 08:36 AM, Stefan Baranoff wrote:
Correct previous bad attempt at allowing sockets to come out of TCP
repair without sending window probes. To avoid changing size of
the repair variable in struct tcp_sock, this lets the decision for
sending probes or not to be made when coming out of repair by
introducing two ways to turn it off.
Thanks for the fix.
Signed-off-by: Eric Dumazet <edumazet@google.com>
On Sun, Jul 15, 2018 at 11:36:37AM -0400, Stefan Baranoff wrote:
Correct previous bad attempt at allowing sockets to come out of TCP
repair without sending window probes. To avoid changing size of
the repair variable in struct tcp_sock, this lets the decision for
sending probes or not to be made when coming out of repair by
introducing two ways to turn it off.
v2:
* Remove erroneous comment; defines now make behavior clear
Fixes: 70b7ff130224 ("tcp: allow user to create repair socket without window probes")
Signed-off-by: Stefan Baranoff <redacted>
@@ -2823,16 +2823,17 @@ static int do_tcp_setsockopt(struct sock *sk, int level,caseTCP_REPAIR:if(!tcp_can_repair_sock(sk))err=-EPERM;-/* 1 for normal repair, 2 for no window probes */-elseif(val==1||val==2){-tp->repair=val;+elseif(val==TCP_REPAIR_ON){+tp->repair=1;sk->sk_reuse=SK_FORCE_REUSE;tp->repair_queue=TCP_NO_QUEUE;-}elseif(val==0){+}elseif(val==TCP_REPAIR_OFF){+tp->repair=0;+sk->sk_reuse=SK_NO_REUSE;+tcp_send_window_probe(sk);+}elseif(val==TCP_REPAIR_OFF_NO_WP){tp->repair=0;sk->sk_reuse=SK_NO_REUSE;-if(tp->repair==1)-tcp_send_window_probe(sk);}elseerr=-EINVAL;
Correct previous bad attempt at allowing sockets to come out of TCP
repair without sending window probes. To avoid changing size of
the repair variable in struct tcp_sock, this lets the decision for
sending probes or not to be made when coming out of repair by
introducing two ways to turn it off.
v2:
* Remove erroneous comment; defines now make behavior clear
Fixes: 70b7ff130224 ("tcp: allow user to create repair socket without window probes")
Signed-off-by: Stefan Baranoff <redacted>