Browse Source

[tcp] Update window even if ACK does not acknowledge new data

iPXE currently ignores ACKs which do not acknowledge any new data.
(In particular, it does not stop the retransmission timer; this is
done to prevent an immediate retransmission if a duplicate ACK is
received while the transmit queue is non-empty.)

If a peer provides a window size of zero and later sends a duplicate
ACK to update the window size, this update will therefore be ignored
and iPXE will never be able to transmit data.

Fix by updating the window size even for ACKs which do not acknowledge
new data.

Reported-by: Wissam Shoukair <wissams@mellanox.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 10 years ago
parent
commit
859664ea2a
1 changed files with 4 additions and 2 deletions
  1. 4
    2
      src/net/tcp.c

+ 4
- 2
src/net/tcp.c View File

890
 		}
890
 		}
891
 	}
891
 	}
892
 
892
 
893
+	/* Update window size */
894
+	tcp->snd_win = win;
895
+
893
 	/* Ignore ACKs that don't actually acknowledge any new data.
896
 	/* Ignore ACKs that don't actually acknowledge any new data.
894
 	 * (In particular, do not stop the retransmission timer; this
897
 	 * (In particular, do not stop the retransmission timer; this
895
 	 * avoids creating a sorceror's apprentice syndrome when a
898
 	 * avoids creating a sorceror's apprentice syndrome when a
911
 		pending_put ( &tcp->pending_flags );
914
 		pending_put ( &tcp->pending_flags );
912
 	}
915
 	}
913
 
916
 
914
-	/* Update SEQ and sent counters, and window size */
917
+	/* Update SEQ and sent counters */
915
 	tcp->snd_seq = ack;
918
 	tcp->snd_seq = ack;
916
 	tcp->snd_sent = 0;
919
 	tcp->snd_sent = 0;
917
-	tcp->snd_win = win;
918
 
920
 
919
 	/* Remove any acknowledged data from transmit queue */
921
 	/* Remove any acknowledged data from transmit queue */
920
 	tcp_process_tx_queue ( tcp, len, NULL, 1 );
922
 	tcp_process_tx_queue ( tcp, len, NULL, 1 );

Loading…
Cancel
Save