diff --git a/src/core/tcp_out.c b/src/core/tcp_out.c index 70bdfea5..78ff0a1a 100644 --- a/src/core/tcp_out.c +++ b/src/core/tcp_out.c @@ -1537,6 +1537,7 @@ tcp_zero_window_probe(struct tcp_pcb *pcb) struct tcp_seg *seg; u16_t len; u8_t is_fin; + u32_t snd_nxt; struct netif *netif; LWIP_DEBUGF(TCP_DEBUG, ("tcp_zero_window_probe: sending ZERO WINDOW probe to ")); @@ -1581,6 +1582,12 @@ tcp_zero_window_probe(struct tcp_pcb *pcb) pbuf_copy_partial(seg->p, d, 1, seg->p->tot_len - seg->len); } + /* The byte may be acknowledged without the window being opened. */ + snd_nxt = ntohl(seg->tcphdr->seqno) + 1; + if (TCP_SEQ_LT(pcb->snd_nxt, snd_nxt)) { + pcb->snd_nxt = snd_nxt; + } + netif = ip_route(&pcb->local_ip, &pcb->remote_ip); if (netif == NULL) { err = ERR_RTE;