Follow-up Comment #4, bug #40363 (project grub): If packet for 10000 reaches GRUB before packet FFFF then packet 10000 would be considered to come before FFFF and will be processed as delayed retransmission and GRUB will discard it but (re)send ack for 0000, then it will take packet for FFFF and process it correctly, send ack for FFFF. Then server will see ack for FFFF and 0000 which it will interpret as 10000 and go on with sending 10001 and GRUB will wait for 10000 which it will never receive. The reason why it worked for you is combination of #40293 and your network being perfect (no losses or duplicates). The full problem is more complex than casting few types. In general there is no solution. Imagine that packet for 00000 got duplicate in network and delayed and arrives at the same time as FFFF and before 10000. Then there is no way to distinguish this situation from packet 10000 arriving. You can handle it only by introducing some assumptions. The most sensible is that you never have packets more than 0x8000 apart. Then (grub_int16_t)(a-b) would give correct compare. Please try attached patch.
(file #29471) _______________________________________________________ Additional Item Attachment: File name: tftp.diff Size:1 KB _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?40363> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/ _______________________________________________ Bug-grub mailing list Bug-grub@gnu.org https://lists.gnu.org/mailman/listinfo/bug-grub