Skip to contentSkip to conversation

tcp: allow user to create repair socket without window probes

PATCH Applied Stefan Baranoff 3 participants 4 messages Jul 10, 2018 – Jul 13, 2018 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 net/ipv4/tcp.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
net/ipv4/tcp.c +5 -3
index e7b53d2a..728ae7a 100644
@@ -2821,14 +2821,16 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
 	case TCP_REPAIR:
 		if (!tcp_can_repair_sock(sk))
 			err = -EPERM;
-		else if (val == 1) {
-			tp->repair = 1;
+		/* 1 for normal repair, 2 for no window probes */
+		else if (val == 1 || val == 2) {
+			tp->repair = val;
 			sk->sk_reuse = SK_FORCE_REUSE;
 			tp->repair_queue = TCP_NO_QUEUE;
 		} else if (val == 0) {
 			tp->repair = 0;
 			sk->sk_reuse = SK_NO_REUSE;
-			tcp_send_window_probe(sk);
+			if (tp->repair == 1)
+				tcp_send_window_probe(sk);
 		} else
 			err = -EINVAL;
 
Signature · 1 line
1.8.3.1
maintainer Applied
#1 lore raw

From: Stefan Baranoff <[email protected]>
Date: Tue, 10 Jul 2018 17:31:10 -0400

Quoted 6 lines

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.

Applied.

#2 lore raw
Quoted 12 lines · David Miller

From: Stefan Baranoff <[email protected]>
Date: Tue, 10 Jul 2018 17:31:10 -0400

Quoted 6 lines

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.

Applied.

This buggy patch was added to net tree, it really should have been sent to net-next.

Stefan, please send a fix.

Thanks.

A message that is not in the archive (sent off-list or not yet received): CAHzKxpbnNOSafBEJRoS3RsL4rywLrgEdhyQqVppBbATwfT4OrQ@mail.gmail.com

#4 lore raw
Quoted 5 lines · Stefan Baranoff

Before I put my foot in my mouth one more time and end up on everyone's naughty list - can someone help guide me on a couple of questions?

What is the correct way to resubmit this, just as a simple v2 or does it need cherry picked out and moved over to net-next somehow?
Part of the fix is to remember to include my header file changes to increase the size of repair from 1 bit to 2 in include/linux/tcp.h - does that make this patch's change require any additional work, notices, etc?

Patch was officially merged, so there wont be a V2.

Please send a patch to fix the issue on top of current David net tree

Thanks.