aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp.c
diff options
context:
space:
mode:
authorStefan Baranoff <sbaranoff@gmail.com>2018-07-10 17:31:10 -0400
committerDavid S. Miller <davem@davemloft.net>2018-07-12 17:33:45 -0400
commit70b7ff130224d2d22a158c7f4aa5e7fb1c95949d (patch)
tree40c2c3b49333960955008e2a5ac29752025a461e /net/ipv4/tcp.c
parent21684dc46c598e477707487c009f9773f7c0382d (diff)
tcp: allow user to create repair socket without window probes
Under rare conditions where repair code may be used it is possible that window probes are either unnecessary or undesired. If the user knows that window probes are not wanted or needed this change allows them to skip sending them when a socket comes out of repair. Signed-off-by: Stefan Baranoff <sbaranoff@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r--net/ipv4/tcp.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 0d43705dd001..8e5e2ca9ab1b 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2823,14 +2823,16 @@ 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 else if (val == 1) { 2826 /* 1 for normal repair, 2 for no window probes */
2827 tp->repair = 1; 2827 else if (val == 1 || val == 2) {
2828 tp->repair = val;
2828 sk->sk_reuse = SK_FORCE_REUSE; 2829 sk->sk_reuse = SK_FORCE_REUSE;
2829 tp->repair_queue = TCP_NO_QUEUE; 2830 tp->repair_queue = TCP_NO_QUEUE;
2830 } else if (val == 0) { 2831 } else if (val == 0) {
2831 tp->repair = 0; 2832 tp->repair = 0;
2832 sk->sk_reuse = SK_NO_REUSE; 2833 sk->sk_reuse = SK_NO_REUSE;
2833 tcp_send_window_probe(sk); 2834 if (tp->repair == 1)
2835 tcp_send_window_probe(sk);
2834 } else 2836 } else
2835 err = -EINVAL; 2837 err = -EINVAL;
2836 2838