Commit 70b7ff13 authored by Stefan Baranoff's avatar Stefan Baranoff Committed by David S. Miller

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: default avatarStefan Baranoff <sbaranoff@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 21684dc4
...@@ -2823,13 +2823,15 @@ static int do_tcp_setsockopt(struct sock *sk, int level, ...@@ -2823,13 +2823,15 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
case TCP_REPAIR: case TCP_REPAIR:
if (!tcp_can_repair_sock(sk)) if (!tcp_can_repair_sock(sk))
err = -EPERM; err = -EPERM;
else if (val == 1) { /* 1 for normal repair, 2 for no window probes */
tp->repair = 1; else if (val == 1 || val == 2) {
tp->repair = val;
sk->sk_reuse = SK_FORCE_REUSE; sk->sk_reuse = SK_FORCE_REUSE;
tp->repair_queue = TCP_NO_QUEUE; tp->repair_queue = TCP_NO_QUEUE;
} else if (val == 0) { } else if (val == 0) {
tp->repair = 0; tp->repair = 0;
sk->sk_reuse = SK_NO_REUSE; sk->sk_reuse = SK_NO_REUSE;
if (tp->repair == 1)
tcp_send_window_probe(sk); tcp_send_window_probe(sk);
} else } else
err = -EINVAL; err = -EINVAL;
......
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