fixed bug #44766 (LWIP_WND_SCALE: tcphdr->wnd was not scaled in two places)

This commit is contained in:
goldsimon 2015-04-08 07:29:11 +02:00
parent 7c47c917b5
commit 4ff1eb1890
2 changed files with 6 additions and 2 deletions

View File

@ -229,6 +229,10 @@ HISTORY
++ Bugfixes: ++ Bugfixes:
2015-03-21: Simon Goldschmidt (patch by Homyak)
* tcp_in.c: fixed bug #44766 (LWIP_WND_SCALE: tcphdr->wnd was not scaled in
two places)
2015-03-21: Simon Goldschmidt 2015-03-21: Simon Goldschmidt
* tcp_impl.h, tcp.c, tcp_in.c: fixed bug #41318 (Bad memory ref in tcp_input() * tcp_impl.h, tcp.c, tcp_in.c: fixed bug #41318 (Bad memory ref in tcp_input()
after tcp_close()) after tcp_close())

View File

@ -967,7 +967,7 @@ tcp_receive(struct tcp_pcb *pcb)
/* Update window. */ /* Update window. */
if (TCP_SEQ_LT(pcb->snd_wl1, seqno) || if (TCP_SEQ_LT(pcb->snd_wl1, seqno) ||
(pcb->snd_wl1 == seqno && TCP_SEQ_LT(pcb->snd_wl2, ackno)) || (pcb->snd_wl1 == seqno && TCP_SEQ_LT(pcb->snd_wl2, ackno)) ||
(pcb->snd_wl2 == ackno && tcphdr->wnd > pcb->snd_wnd)) { (pcb->snd_wl2 == ackno && SND_WND_SCALE(pcb, tcphdr->wnd) > pcb->snd_wnd)) {
pcb->snd_wnd = SND_WND_SCALE(pcb, tcphdr->wnd); pcb->snd_wnd = SND_WND_SCALE(pcb, tcphdr->wnd);
/* keep track of the biggest window announced by the remote host to calculate /* keep track of the biggest window announced by the remote host to calculate
the maximum segment size */ the maximum segment size */
@ -989,7 +989,7 @@ tcp_receive(struct tcp_pcb *pcb)
LWIP_DEBUGF(TCP_WND_DEBUG, ("tcp_receive: window update %"U16_F"\n", pcb->snd_wnd)); LWIP_DEBUGF(TCP_WND_DEBUG, ("tcp_receive: window update %"U16_F"\n", pcb->snd_wnd));
#if TCP_WND_DEBUG #if TCP_WND_DEBUG
} else { } else {
if (pcb->snd_wnd != tcphdr->wnd) { if (pcb->snd_wnd != SND_WND_SCALE(pcb, tcphdr->wnd)) {
LWIP_DEBUGF(TCP_WND_DEBUG, LWIP_DEBUGF(TCP_WND_DEBUG,
("tcp_receive: no window update lastack %"U32_F" ackno %" ("tcp_receive: no window update lastack %"U32_F" ackno %"
U32_F" wl1 %"U32_F" seqno %"U32_F" wl2 %"U32_F"\n", U32_F" wl1 %"U32_F" seqno %"U32_F" wl2 %"U32_F"\n",