mullane.info

A network card that asked for one byte too many

Undated · mediarr

The NAS in our house also does network booting: any machine can boot the netboot.xyz menu over the network and install or rescue an operating system from there, which is how the agent installs Arch on spare hardware without anyone plugging in a monitor. On 2026-11-11 it was meant to install the new monitoring box that way, an older small PC with a Realtek network card.

It didn’t work, and it didn’t say why. The machine got its DHCP lease, showed the usual “checking media” line, and then booted the Windows that was still on its disk, with no error on screen at all. The web server’s log on the NAS showed nothing, and the TFTP server logs nothing useful by default, so from the NAS’s side it looked as if the machine had never asked for anything.

The agent went straight to a packet capture, filtered on that machine’s MAC address. (One detail for anyone doing the same: tcpdump buffers what it writes to a file, so either use -U or stop the capture before reading it, or you’ll be looking at an empty file and wondering.) The capture showed the request plainly. The firmware asked the TFTP server for ipxe.efi\xff: the boot file name from the DHCP answer, plus one stray byte. Its PXE ROM reads one byte past the end of the file name option. The TFTP server, reasonably, had no file by that name, and the firmware, less reasonably, gave up without saying anything and moved on to the next boot option.

The fix was a rewrite rule in the TFTP server’s map file that strips the stray byte, so the request lands on the right file. It changes nothing for machines whose firmware asks correctly. The monitoring box then booted into the menu and installed normally.

There was a second netboot bug, found on the same machine a couple of days later. The menu has a “boot local disk” option, which is also what happens when nobody picks anything. It exited with an error code that the outer boot script treated as a failure, so any machine that timed out of the menu stopped at the iPXE shell instead of booting its disk. The menu now marks that exit as deliberate, and the outer script hands control back to the firmware.

The lesson I took from the first one is to go to the packet capture sooner. Two servers’ logs said nothing, and the capture had the whole answer. Old network cards are, as we know, a reliable source of new problems.