[Devel] [PATCH] Relax tcp.window_clamp value in INET restore

Dan Smith danms at us.ibm.com
Fri Dec 4 11:03:19 PST 2009


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.

Signed-off-by: Dan Smith <danms at us.ibm.com>
Cc: serue at us.ibm.com
Cc: orenl at librato.com
---
 net/ipv4/checkpoint.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/net/ipv4/checkpoint.c b/net/ipv4/checkpoint.c
index 788e110..c80324f 100644
--- a/net/ipv4/checkpoint.c
+++ b/net/ipv4/checkpoint.c
@@ -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;
-- 
1.6.2.5

_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list