diff --git a/CHANGELOG b/CHANGELOG index 21a85c94..b427d9c4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -6,7 +6,7 @@ HISTORY ++ New features: - 2016-02-22: Ivan Delamer: + 2016-02-22: Ivan Delamer * Initial 6LoWPAN support 2015-12-26: Martin Hentschel and Dirk Ziegelmeier @@ -302,6 +302,9 @@ HISTORY ++ Bugfixes: + 2016-03-16: Deomid Ryabkov + * tcp_out.c: fixed bug #46384 Segment size calculation bug with MSS != TCP_MSS + 2016-03-05: Simon Goldschmidt * err.h/.c, sockets.c: ERR_IF is not necessarily a fatal error diff --git a/src/core/tcp_out.c b/src/core/tcp_out.c index fa8d77fb..a7b05954 100644 --- a/src/core/tcp_out.c +++ b/src/core/tcp_out.c @@ -469,7 +469,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;