Fixed bug #26236: "TCP options (timestamp) don't work with no-copy-tcpwrite": deallocate option data, only concat segments with same flags

This commit is contained in:
goldsimon 2009-04-19 12:42:48 +00:00
parent 542b8fffb1
commit ed65d9cd75
2 changed files with 8 additions and 2 deletions

View File

@ -83,6 +83,10 @@ HISTORY
++ Bugfixes:
2009-04-19 Simon Goldschmidt
* tcp_out.c: Fixed bug #26236: "TCP options (timestamp) don't work with
no-copy-tcpwrite": deallocate option data, only concat segments with same flags
2009-04-19 Simon Goldschmidt
* tcp_out.c: Fixed bug #25094: "Zero-length pbuf" (options are now allocated
in the header pbuf, not the data pbuf)

View File

@ -344,9 +344,11 @@ tcp_enqueue(struct tcp_pcb *pcb, void *arg, u16_t len,
!(TCPH_FLAGS(useg->tcphdr) & (TCP_SYN | TCP_FIN)) &&
!(flags & (TCP_SYN | TCP_FIN)) &&
/* fit within max seg size */
useg->len + queue->len <= pcb->mss) {
(useg->len + queue->len <= pcb->mss) &&
/* only concatenate segments with the same options */
(useg->flags == queue->flags)) {
/* Remove TCP header from first segment of our to-be-queued list */
if(pbuf_header(queue->p, -TCP_HLEN)) {
if(pbuf_header(queue->p, -(TCP_HLEN + optlen))) {
/* Can we cope with this failing? Just assert for now */
LWIP_ASSERT("pbuf_header failed\n", 0);
TCP_STATS_INC(tcp.err);