pypxe / PyPXE

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

bug fix #200

Open RayCh001 opened 1 year ago

RayCh001 commented 1 year ago

tftp.py have 2 bug at line 218 & 223 . "self.block = block + 1" should be "self.block = block + self.wrap 65536 + 1" since block is set by block no from ack message, block will rotate from 1 to 65536(0), then self.block rotate from 1 to 65536(0) too, finally , "self.fh.seek(self.blksize (self.block - 1))" would not get right position for file its size > 2*16512(65536)

icb- commented 1 year ago

tftp.py have 2 bug at line 218 & 223 . "self.block = block + 1" should be "self.block = block + self.wrap * 65536 + 1" since block is set by block no from ack message, block will rotate from 1 to 65536(0), then self.block rotate from 1 to 65536(0) too,

Can you submit a PR with a fix?

finally , "self.fh.seek(self.blksize * (self.block - 1))" would not get right position for file its size > 2*16512(65536)

While this may be true, TFTP is unsuitable for a 2 terabyte file.