mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-01-27 21:35:48 +00:00
Revert "tcp_recved: check for overflow and warn about too big values"
This reverts commit ebb0dc14a7336c793d32c8e9ebde5bd9666f2a65. It changes the behaviour to assert for applications running good so far. Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
This commit is contained in:
parent
d184463e2a
commit
1940cae827
@ -968,7 +968,6 @@ void
|
|||||||
tcp_recved(struct tcp_pcb *pcb, u16_t len)
|
tcp_recved(struct tcp_pcb *pcb, u16_t len)
|
||||||
{
|
{
|
||||||
u32_t wnd_inflation;
|
u32_t wnd_inflation;
|
||||||
tcpwnd_size_t rcv_wnd;
|
|
||||||
|
|
||||||
LWIP_ASSERT_CORE_LOCKED();
|
LWIP_ASSERT_CORE_LOCKED();
|
||||||
|
|
||||||
@ -978,8 +977,10 @@ tcp_recved(struct tcp_pcb *pcb, u16_t len)
|
|||||||
LWIP_ASSERT("don't call tcp_recved for listen-pcbs",
|
LWIP_ASSERT("don't call tcp_recved for listen-pcbs",
|
||||||
pcb->state != LISTEN);
|
pcb->state != LISTEN);
|
||||||
|
|
||||||
rcv_wnd = pcb->rcv_wnd + len;
|
pcb->rcv_wnd = (tcpwnd_size_t)(pcb->rcv_wnd + len);
|
||||||
if (rcv_wnd < pcb->rcv_wnd || (len != 0 && rcv_wnd == pcb->rcv_wnd)) {
|
if (pcb->rcv_wnd > TCP_WND_MAX(pcb)) {
|
||||||
|
pcb->rcv_wnd = TCP_WND_MAX(pcb);
|
||||||
|
} else if (pcb->rcv_wnd == 0) {
|
||||||
/* rcv_wnd overflowed */
|
/* rcv_wnd overflowed */
|
||||||
if (TCP_STATE_IS_CLOSING(pcb->state)) {
|
if (TCP_STATE_IS_CLOSING(pcb->state)) {
|
||||||
/* In passive close, we allow this, since the FIN bit is added to rcv_wnd
|
/* In passive close, we allow this, since the FIN bit is added to rcv_wnd
|
||||||
@ -989,12 +990,6 @@ tcp_recved(struct tcp_pcb *pcb, u16_t len)
|
|||||||
} else {
|
} else {
|
||||||
LWIP_ASSERT("tcp_recved: len wrapped rcv_wnd\n", 0);
|
LWIP_ASSERT("tcp_recved: len wrapped rcv_wnd\n", 0);
|
||||||
}
|
}
|
||||||
} else if (rcv_wnd <= TCP_WND_MAX(pcb)) {
|
|
||||||
pcb->rcv_wnd = rcv_wnd;
|
|
||||||
} else {
|
|
||||||
LWIP_ASSERT("tcp_recved: len overflowed TCP_WND_MAX",
|
|
||||||
rcv_wnd <= TCP_WND_MAX(pcb));
|
|
||||||
pcb->rcv_wnd = TCP_WND_MAX(pcb);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wnd_inflation = tcp_update_rcv_ann_wnd(pcb);
|
wnd_inflation = tcp_update_rcv_ann_wnd(pcb);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user