iPXE currently forces sending (i.e. sends a pure ACK even in the absence of fresh data to send) only in response to packets that consume sequence space or that lie outside of the receive window. This ignores the possibility that a previous ACK was not actually sent (due to, for example, the retransmission timer running). This does not cause incorrect behaviour, but does cause unnecessary retransmissions from our peer. For example: 1. Peer sends final data packet (ack 106 seq 521..523) 2. We send FIN (seq 106..107 ack 523) 3. Peer sends FIN (ack 106 seq 523..524) 4. We send nothing since retransmission timer is running for our FIN 5. Peer ACKs our FIN (ack 107 seq 524..524) 6. We send nothing since this packet consumes no sequence space 7. Peer retransmits FIN (ack 107 seq 523..524) 8. We ACK peer's FIN (seq 107..107 ack 524) What should happen at step (6) is that we should ACK the peer's FIN, since we can deduce that we have never sent this ACK. Fix by maintaining an "ACK pending" flag that is set whenever we are made aware that our peer needs an ACK (whether by consuming sequence space or by sending a packet that appears out of order), and is cleared only when the ACK packet has been transmitted. Reported-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>tags/v1.20.1
|
|
||
93 |
|
93 |
|
94 |
|
94 |
|
95 |
|
95 |
|
|
96 |
|
|
|
97 |
|
|
96 |
|
98 |
|
97 |
|
99 |
|
98 |
|
100 |
|
|
|
||
396 |
|
398 |
|
397 |
|
399 |
|
398 |
|
400 |
|
399 |
|
|
|
400 |
|
401 |
|
401 |
|
402 |
|
402 |
|
403 |
|
|
|
||
404 |
|
405 |
|
405 |
|
406 |
|
406 |
|
407 |
|
407 |
|
|
|
|
408 |
|
|
408 |
|
409 |
|
409 |
|
410 |
|
410 |
|
411 |
|
|
|
||
438 |
|
439 |
|
439 |
|
440 |
|
440 |
|
441 |
|
441 |
|
|
|
|
442 |
|
|
442 |
|
443 |
|
443 |
|
444 |
|
444 |
|
445 |
|
|
|
||
519 |
|
520 |
|
520 |
|
521 |
|
521 |
|
522 |
|
|
523 |
|
|
|
524 |
|
|
|
525 |
|
|
522 |
|
526 |
|
523 |
|
527 |
|
524 |
|
528 |
|
|
|
||
552 |
|
556 |
|
553 |
|
557 |
|
554 |
|
558 |
|
555 |
|
|
|
|
559 |
|
|
556 |
|
560 |
|
557 |
|
561 |
|
558 |
|
562 |
|
|
|
||
709 |
|
713 |
|
710 |
|
714 |
|
711 |
|
715 |
|
|
716 |
|
|
712 |
|
717 |
|
713 |
|
718 |
|
714 |
|
719 |
|
|
|
||
927 |
|
932 |
|
928 |
|
933 |
|
929 |
|
934 |
|
930 |
|
|
|
931 |
|
935 |
|
932 |
|
936 |
|
933 |
|
937 |
|
|
|
||
967 |
|
971 |
|
968 |
|
972 |
|
969 |
|
973 |
|
970 |
|
|
|
|
974 |
|
|
971 |
|
975 |
|
972 |
|
976 |
|
973 |
|
977 |
|
|
|
||
1002 |
|
1006 |
|
1003 |
|
1007 |
|
1004 |
|
1008 |
|
|
1009 |
|
|
|
1010 |
|
|
|
1011 |
|
|
|
1012 |
|
|
|
1013 |
|
|
|
1014 |
|
|
1005 |
|
1015 |
|
1006 |
|
1016 |
|
1007 |
|
1017 |
|
|
|
||
1031 |
|
1041 |
|
1032 |
|
1042 |
|
1033 |
|
1043 |
|
1034 |
|
|
|
1035 |
|
|
|
1036 |
|
|
|
1037 |
|
|
|
1038 |
|
|
|
1039 |
|
|
|
1040 |
|
|
|
1041 |
|
|
|
1042 |
|
|
|
1043 |
|
|
|
1044 |
|
|
|
1045 |
|
|
|
1046 |
|
|
|
|
1044 |
|
|
|
1045 |
|
|
1047 |
|
1046 |
|
1048 |
|
1047 |
|
1049 |
|
1048 |
|
|
|
||
1087 |
|
1086 |
|
1088 |
|
1087 |
|
1089 |
|
1088 |
|
1090 |
|
|
|
|
1089 |
|
|
1091 |
|
1090 |
|
1092 |
|
1091 |
|
1093 |
|
1092 |
|
|
|
||
1125 |
|
1124 |
|
1126 |
|
1125 |
|
1127 |
|
1126 |
|
1128 |
|
|
|
|
1127 |
|
|
1129 |
|
1128 |
|
1130 |
|
1129 |
|
1131 |
|
1130 |
|