boot - Handle tftp block overflows
commit6e1b61075c183daad7a38733a38ca960abc3ed0d
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 2 Nov 2018 02:06:14 +0000 (1 19:06 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 2 Nov 2018 02:11:46 +0000 (1 19:11 -0700)
tree5f10536d0a712d5607bd8949e6af645f4a02b827
parente8f4f8225cec675a1c80eaf9acca814b8cc6cc42
boot - Handle tftp block overflows

* Properly truncate the block number when comparing against the
  incoming packet.  TFTP only implements 16-bit block numbers.
  This allows the boot loader to access files larger than 32MB
  via TFTP.

* Twiddle every 256 reads instead of every 16.

* Note that TFTP is not really a suitable protocol for loading the
  kernel because the ELF loader seeks past the debug info which
  can be well over a hundred megabytes in order to get to the syms.
  NFS is preferred.
lib/libstand/tftp.c