Skip to content

Commit 70b7ff1

Browse files
stefan-baranoffdavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 21684dc commit 70b7ff1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

net/ipv4/tcp.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2823,14 +2823,16 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
28232823
case TCP_REPAIR:
28242824
if (!tcp_can_repair_sock(sk))
28252825
err = -EPERM;
2826-
else if (val == 1) {
2827-
tp->repair = 1;
2826+
/* 1 for normal repair, 2 for no window probes */
2827+
else if (val == 1 || val == 2) {
2828+
tp->repair = val;
28282829
sk->sk_reuse = SK_FORCE_REUSE;
28292830
tp->repair_queue = TCP_NO_QUEUE;
28302831
} else if (val == 0) {
28312832
tp->repair = 0;
28322833
sk->sk_reuse = SK_NO_REUSE;
2833-
tcp_send_window_probe(sk);
2834+
if (tp->repair == 1)
2835+
tcp_send_window_probe(sk);
28342836
} else
28352837
err = -EINVAL;
28362838

0 commit comments

Comments
 (0)