Skip to content

Commit

Permalink
Patch for TCP segment size calculation issue.
Browse files Browse the repository at this point in the history
Original fix is here: lwip-tcpip/lwip@8e8571d

Issue spotted and documented here: #2654

PR submitted to upstream: pfalcon/esp-open-lwip#10
  • Loading branch information
slav-at-attachix committed Aug 10, 2023
1 parent e1b0f2b commit 65e9404
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Sming/Arch/Esp8266/Components/esp-open-lwip/esp-open-lwip.patch
Original file line number Diff line number Diff line change
Expand Up @@ -605,3 +605,16 @@ index bbb126a..4cd8840 100644
+void espconn_init(void)
{
}
diff --git a/lwip/core/tcp_out.c b/lwip/core/tcp_out.c
index e2f8e9a..8f4d170 100644
--- a/lwip/core/tcp_out.c
+++ b/lwip/core/tcp_out.c
@@ -448,7 +448,7 @@ tcp_write(struct tcp_pcb *pcb, const void *arg, u16_t len, u8_t apiflags)
if (oversize > 0) {
LWIP_ASSERT("inconsistent oversize vs. space", oversize_used <= space);
seg = last_unsent;
- oversize_used = oversize < len ? oversize : len;
+ oversize_used = LWIP_MIN(space, LWIP_MIN(oversize, len));
pos += oversize_used;
oversize -= oversize_used;
space -= oversize_used;

0 comments on commit 65e9404

Please sign in to comment.