fixed bug #46384 Segment size calculation bug with MSS != TCP_MSS

This commit is contained in:
sg 2016-03-16 16:56:15 +01:00
parent 0d576aa521
commit 8e8571da6a
2 changed files with 5 additions and 2 deletions

View File

@ -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

View File

@ -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;