aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp.c
diff options
context:
space:
mode:
authorStefan Baranoff <sbaranoff@gmail.com>2018-07-15 11:36:37 -0400
committerDavid S. Miller <davem@davemloft.net>2018-07-16 17:06:44 -0400
commit31048d7aedf31bf0f69c54a662944632f29d82f2 (patch)
tree32de842218f56480c1a6090df6f05a2c47da601e /net/ipv4/tcp.c
parent432e629e56432064761be63bcd5e263c0920430d (diff)
tcp: Fix broken repair socket window probe patch
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 <sbaranoff@gmail.com> Signed-off-by: Eric Dumazet <edumazet@google.com> Acked-by: Andrei Vagin <avagin@virtuozzo.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r--net/ipv4/tcp.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 8e5e2ca9ab1b..ec2186e3087f 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2823,16 +2823,17 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
2823 case TCP_REPAIR: 2823 case TCP_REPAIR:
2824 if (!tcp_can_repair_sock(sk)) 2824 if (!tcp_can_repair_sock(sk))
2825 err = -EPERM; 2825 err = -EPERM;
2826 /* 1 for normal repair, 2 for no window probes */ 2826 else if (val == TCP_REPAIR_ON) {
2827 else if (val == 1 || val == 2) { 2827 tp->repair = 1;
2828 tp->repair = val;
2829 sk->sk_reuse = SK_FORCE_REUSE; 2828 sk->sk_reuse = SK_FORCE_REUSE;
2830 tp->repair_queue = TCP_NO_QUEUE; 2829 tp->repair_queue = TCP_NO_QUEUE;
2831 } else if (val == 0) { 2830 } else if (val == TCP_REPAIR_OFF) {
2831 tp->repair = 0;
2832 sk->sk_reuse = SK_NO_REUSE;
2833 tcp_send_window_probe(sk);
2834 } else if (val == TCP_REPAIR_OFF_NO_WP) {
2832 tp->repair = 0; 2835 tp->repair = 0;
2833 sk->sk_reuse = SK_NO_REUSE; 2836 sk->sk_reuse = SK_NO_REUSE;
2834 if (tp->repair == 1)
2835 tcp_send_window_probe(sk);
2836 } else 2837 } else
2837 err = -EINVAL; 2838 err = -EINVAL;
2838 2839