Skip to contentSkip to conversation

Relax tcp.window_clamp value in INET restore

PATCH Applied Dan Smith 3 participants 3 messages Dec 4, 2009 – Dec 6, 2009 1 message not in the archive Networking

lore
Share & tools
lore

Dan Smith

author
#0 lore raw

PATCH 1/1 Relax tcp.window_clamp value in INET restore

This value can grow higher than 16k, but it clamped at packet receive time if over that limit. Instead of failing here, just clamp to the same limit.

---
 net/ipv4/checkpoint.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
net/ipv4/checkpoint.c +2 -4
index 788e110..c80324f 100644
@@ -429,10 +429,8 @@ static int inet_precheck(struct socket *sock, struct ckpt_hdr_socket_inet *in)
 	/* do_tcp_setsockopt() quietly makes this coercion */
 	if (in->tcp.window_clamp < (SOCK_MIN_RCVBUF / 2))
 		in->tcp.window_clamp = SOCK_MIN_RCVBUF / 2;
-	else if (in->tcp.window_clamp > 65535U) {
-		ckpt_debug("invalid window_clamp value\n");
-		return -EINVAL;
-	}
+	else
+		in->tcp.window_clamp = min(in->tcp.window_clamp, 65535U);
 
 	if (in->tcp.rcv_ssthresh > (4U * in->tcp.advmss))
 		in->tcp.rcv_ssthresh = 4U * in->tcp.advmss;
Signature · 1 line
1.6.2.5

A message that is not in the archive (sent off-list or not yet received): 1259953399-8530-1-git-send-email-danms-r/[email protected]

Tested-by
#2 lore raw
Quoted 6 lines · Dan Smith

This value can grow higher than 16k, but it clamped at packet receive time if over that limit. Instead of failing here, just clamp to the same limit.

Thanks, Dan.

-serge

Quoted 24 lines
---
 net/ipv4/checkpoint.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
net/ipv4/checkpoint.c +2 -4
index 788e110..c80324f 100644
@@ -429,10 +429,8 @@ static int inet_precheck(struct socket *sock, struct ckpt_hdr_socket_inet *in)
 	/* do_tcp_setsockopt() quietly makes this coercion */
 	if (in->tcp.window_clamp < (SOCK_MIN_RCVBUF / 2))
 		in->tcp.window_clamp = SOCK_MIN_RCVBUF / 2;
-	else if (in->tcp.window_clamp > 65535U) {
-		ckpt_debug("invalid window_clamp value\n");
-		return -EINVAL;
-	}
+	else
+		in->tcp.window_clamp = min(in->tcp.window_clamp, 65535U);
 
 	if (in->tcp.rcv_ssthresh > (4U * in->tcp.advmss))
 		in->tcp.rcv_ssthresh = 4U * in->tcp.advmss;
Signature · 1 line
1.6.2.5
Applied
#3 lore raw
In reply to a message not in the archive

Queued for ckpt-v19-rc3, thanks.

Oren.

Quoted 28 lines · Dan Smith

This value can grow higher than 16k, but it clamped at packet receive time if over that limit. Instead of failing here, just clamp to the same limit.

---
 net/ipv4/checkpoint.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
net/ipv4/checkpoint.c +2 -4
index 788e110..c80324f 100644
@@ -429,10 +429,8 @@ static int inet_precheck(struct socket *sock, struct ckpt_hdr_socket_inet *in)
 	/* do_tcp_setsockopt() quietly makes this coercion */
 	if (in->tcp.window_clamp < (SOCK_MIN_RCVBUF / 2))
 		in->tcp.window_clamp = SOCK_MIN_RCVBUF / 2;
-	else if (in->tcp.window_clamp > 65535U) {
-		ckpt_debug("invalid window_clamp value\n");
-		return -EINVAL;
-	}
+	else
+		in->tcp.window_clamp = min(in->tcp.window_clamp, 65535U);
 
 	if (in->tcp.rcv_ssthresh > (4U * in->tcp.advmss))
 		in->tcp.rcv_ssthresh = 4U * in->tcp.advmss;