From 95445fc3284e757832fde1642e4bb937e66133d4 Mon Sep 17 00:00:00 2001 From: kieranm Date: Thu, 28 Jan 2010 13:14:42 +0000 Subject: [PATCH] Ensure ssthresh >= 2*MSS --- CHANGELOG | 2 ++ src/core/tcp.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 3a2b17d1..dbab0d7b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -56,6 +56,8 @@ HISTORY ++ Bugfixes: + 2010-01-28: Kieran Mansley + * tcp.c: Ensure ssthresh >= 2*MSS 2010-01-27: Simon Goldschmidt * tcp.h, tcp.c, tcp_in.c: Fixed bug #27871: Calling tcp_abort() in recv diff --git a/src/core/tcp.c b/src/core/tcp.c index 1ac824db..2b328424 100644 --- a/src/core/tcp.c +++ b/src/core/tcp.c @@ -650,8 +650,8 @@ tcp_slowtmr(void) /* Reduce congestion window and ssthresh. */ eff_wnd = LWIP_MIN(pcb->cwnd, pcb->snd_wnd); pcb->ssthresh = eff_wnd >> 1; - if (pcb->ssthresh < pcb->mss) { - pcb->ssthresh = pcb->mss * 2; + if (pcb->ssthresh < (pcb->mss << 1)) { + pcb->ssthresh = (pcb->mss << 1); } pcb->cwnd = pcb->mss; LWIP_DEBUGF(TCP_CWND_DEBUG, ("tcp_slowtmr: cwnd %"U16_F