diff --git a/src/core/tcp_in.c b/src/core/tcp_in.c index c050a05a..eff719c6 100644 --- a/src/core/tcp_in.c +++ b/src/core/tcp_in.c @@ -758,7 +758,9 @@ tcp_receive(struct tcp_pcb *pcb) /* Update the send buffer space. */ pcb->acked = ackno - pcb->lastack; - pcb->snd_buf += pcb->acked; + + /* FIX: Data split over odd boundaries */ + pcb->snd_buf += ((pcb->acked+1) & ~0x1); /* Even the send buffer */ /* Reset the fast retransmit variables. */ pcb->dupacks = 0; diff --git a/src/core/tcp_out.c b/src/core/tcp_out.c index 368032d3..de92fba1 100644 --- a/src/core/tcp_out.c +++ b/src/core/tcp_out.c @@ -337,7 +337,10 @@ tcp_enqueue(struct tcp_pcb *pcb, void *arg, u16_t len, ++len; } pcb->snd_lbb += len; - pcb->snd_buf -= len; + + /* FIX: Data split over odd boundaries */ + pcb->snd_buf -= ((len+1) & ~0x1); /* Even the send buffer */ + /* update number of segments on the queues */ pcb->snd_queuelen = queuelen; LWIP_DEBUGF(TCP_QLEN_DEBUG, ("tcp_enqueue: %d (after enqueued)\n", pcb->snd_queuelen));