From 28476e3b7b411414a79381365a72b634bea4d029 Mon Sep 17 00:00:00 2001 From: sg Date: Sun, 18 Jan 2015 14:08:11 +0100 Subject: [PATCH] Fixed bug #38315 tcp_eff_send_mss_impl() always subtract the difference in IPv6 header size --- src/core/tcp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/tcp.c b/src/core/tcp.c index bc4df43a..4051579a 100644 --- a/src/core/tcp.c +++ b/src/core/tcp.c @@ -1707,8 +1707,10 @@ tcp_eff_send_mss_impl(u16_t sendmss, ipX_addr_t *dest if (mtu != 0) { mss_s = mtu - IP_HLEN - TCP_HLEN; #if LWIP_IPV6 - /* for IPv6, subtract the difference in header size */ - mss_s -= (IP6_HLEN - IP_HLEN); + if (isipv6) { + /* for IPv6, subtract the difference in header size */ + mss_s -= (IP6_HLEN - IP_HLEN); + } #endif /* LWIP_IPV6 */ /* RFC 1122, chap 4.2.2.6: * Eff.snd.MSS = min(SendMSS+20, MMS_S) - TCPhdrsize - IPoptionsize