pypxe / PyPXE

Pure Python PXE (DHCP-(Proxy)/TFTP/HTTP/NBD) Server
MIT License
547 stars 125 forks source link

Fix for Improper TFTP Sequence Wraps #96

Closed mmattioli closed 9 years ago

mmattioli commented 9 years ago

Bug Fix

If the size of the file being transferred via TFTP is a multiple of the block size then improper sequence wrapping occurs causing issues with file transfers. See #94 for details.

icb- commented 9 years ago

This was actually two separate fixes. While making TFTP sequence wraps work, I discovered that if the file we're sending is a multiple of the blocksize, we don't send the final empty block to signal that we're done. It works most of the time because if the file isn't a multiple of the blocksize, the last block is short, and the receiver interprets that as being finished.