Skip to content

Commit

Permalink
issue: 1181379 Fix TCP zero window probe when there is data in-flight
Browse files Browse the repository at this point in the history
TCP zero-window probe message should not be sent when there
is data in-flight (unacked packets, pcb->unacked != NULL).

Signed-off-by: Daniel Libenson <[email protected]>
  • Loading branch information
DanielLibenson authored and Liran Oz committed Nov 13, 2017
1 parent 946cf9c commit a603f61
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/vma/lwip/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ tcp_slowtmr(struct tcp_pcb* pcb)
LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: max DATA retries reached\n"));
} else {
if (pcb->persist_backoff > 0) {
/* If snd_wnd is zero, use persist timer to send 1 byte probes
/* If snd_wnd is zero and pcb->unacked is NULL , use persist timer to send 1 byte probes
* instead of using the standard retransmission mechanism. */
pcb->persist_cnt++;
if (pcb->persist_cnt >= tcp_persist_backoff[pcb->persist_backoff-1]) {
Expand Down
2 changes: 1 addition & 1 deletion src/vma/lwip/tcp_in.c
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ tcp_receive(struct tcp_pcb *pcb, tcp_in_data* in_data)
pcb->snd_wl1 = in_data->seqno;
pcb->snd_wl2 = in_data->ackno;
if (pcb->snd_wnd == 0) {
if (pcb->persist_backoff == 0) {
if (pcb->persist_backoff == 0 && pcb->unacked == NULL) {
/* start persist timer */
pcb->persist_cnt = 0;
pcb->persist_backoff = 1;
Expand Down
8 changes: 3 additions & 5 deletions src/vma/lwip/tcp_out.c
Original file line number Diff line number Diff line change
Expand Up @@ -1564,12 +1564,10 @@ tcp_zero_window_probe(struct tcp_pcb *pcb)
" pcb->tmr %"U32_F" pcb->keep_cnt_sent %"U16_F"\n",
tcp_ticks, pcb->tmr, pcb->keep_cnt_sent));

seg = pcb->unacked;

if(seg == NULL) {
seg = pcb->unsent;
}
/* Only consider unsent, persist timer should be off when there data is in-flight */
seg = pcb->unsent;
if(seg == NULL) {
/* Not expected, persist timer should be off when the send buffer is empty */
return;
}

Expand Down

0 comments on commit a603f61

Please sign in to comment.