lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 28 Feb 2012 16:28:17 +0800
From:	roy.qing.li@...il.com
To:	netdev@...r.kernel.org
Subject: [PATCH 2/2] ipv4: fix mss comparison 

From: RongQing.Li <roy.qing.li@...il.com>

mss should compare with 65535 - sizeof(struct tcphdr),  
the largest mss is 65535 - sizeof(struct tcphdr).  
40 is sum of sizeof(struct tcphdr) and sizeof(struct iphdr)

Signed-off-by: RongQing.Li <roy.qing.li@...il.com>
---
 net/ipv4/route.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 0489ced..c72f765 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1914,8 +1914,8 @@ static unsigned int ipv4_default_advmss(const struct dst_entry *dst)
 	if (advmss == 0) {
 		advmss = max_t(unsigned int, dst->dev->mtu - 40,
 			       ip_rt_min_advmss);
-		if (advmss > 65535 - 40)
-			advmss = 65535 - 40;
+		if (advmss > 65535 - sizeof(struct tcphdr))
+			advmss = 65535 - sizeof(struct tcphdr);
 	}
 	return advmss;
 }
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists