mirror of
https://github.com/netbootxyz/netboot.xyz.git
synced 2026-04-25 23:25:54 +03:00
[GH-ISSUE #1198] Filename not properly interpreted by TFTP #1870
Labels
No labels
Hacktoberfest
Hacktoberfest
bootloader
bsd
bug
confirmed
documentation
duplicate
enhancement
enhancement
enhancement
eol
experimental-merged
freebsd
help wanted
invalid
investigate
ipxe
linux
live-os
memdisk
menu
no-issue-activity
no-issue-activity
pull-request
released
todo
upstream
windows
windows
work-in-progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/netboot.xyz#1870
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @BloodBlight on GitHub (Feb 5, 2023).
Original GitHub issue: https://github.com/netbootxyz/netboot.xyz/issues/1198
Describe the bug
This is related to this discussion from a while back:
https://github.com/netbootxyz/netboot.xyz/discussions/1133
I have an older client is sending a file name to the TFTP server, but is not being properly decoded into Unicode. I am not sure if the TFTP server is from another project (and this should be posted there), so please feel free to re-direct me and I will post it there.
What I see in the logs:
2022-07-08 15:28:56 notice in.tftpd[88]: RRQ from 192.168.10.206 filename netboot.xyz.kpxe�����The last characters (�) is (U+FFFD), a Unicode character for "Replacement Character". As it is at the end of the string, there could be a few causes, but without knowing the code...
To Reproduce
Attempt to boot from PXE.
Expected behavior
Should download the file and start booting.
Additional context
This is an old board, but a good one (kinda like a raspberry Pi, years before they were a thing. I can't find the exact model, but it is basically a Jetway J7F4K1G5DS-LF, just a bit slower (1.2GHz).
@MartinLoeper commented on GitHub (Oct 18, 2023):
I am noticing the same for a Lenovo T460 laptop. I am getting the following hex dump on the wire: 6e 65 74 62 6f 6f 74 2e 78 79 7a 2e 65 66 69 ff 00. The ff byte before the nullbyte should not be there. Is this a bug in the uefi firmware or am I missing something?
@antonym commented on GitHub (Oct 19, 2023):
Not really sure if there's anything on my side I can do about it, using Proxmox VMs to my docker container running tftp it seems to pull up without issues:
Wonder if whatever is serving up the filename for DHCP is putting some characters on the file name? Where are you setting next-server and setting the filename from? Is there a common router that may be appending some characters to the filename?
I think I've seen some other scenarios where people have had extra characters added to their filename, it could be a bug in a common router you might be using as well:
https://www.reddit.com/r/linuxquestions/comments/4rwesw/tftpboot_invalid_character_in_requested_filename/
@BloodBlight commented on GitHub (Oct 19, 2023):
I can have two computers sitting next to each other, one works, the other doesn't. Same target. I will verify that though (might not be today) to make sure I am not full of it. So I am fairly sure it is something about the way the client is making the request.
DHCP Is being handled by a UniFi USG 3. Fairly basic config:
https://imgur.com/a/ZnOfpZw
No idea why Imgur is tagging it as mature... Ignore.
@megapearl commented on GitHub (Jan 18, 2024):
Having the same problem here.
Client:
Intel UNDI, PXE-2.1 (build 082)
Copyright (C) 1997-2000 Intel Corporation
This Product is covered by one or more of the following patents:
US5,307,459, US5,434,872, US5,732,094, US6,570,884, US6,115,776 and
US6,327,625
Realtek PCI Express Gigabit Ethernet Controller Series v2.26 (090219)
CLIENT MAC ADDR: 90 FB A6 41 09 ED CUID: C996DEBD-1DF6-1E31-E57C-90FBA64109ED
CLIENT IP: 10.0.0.100
MASK: 255.255.255.0 DHCP IP: 10.0.0.1
CATEWAY IP: 10.0.0.1
TFTP .
PXE-T01: File not found
PXE-E3B: TFTP Error - File Not found
PSE-MOF: Exiting PXE ROM.
Reboot and Select proper Boot device or Insert Boot Media in selected Boot device and press a key
Server:

@BloodBlight commented on GitHub (Jan 18, 2024):
I am tempted to do a packet capture...
I have had multiple older systems have this issue now...
@rudiservo commented on GitHub (Feb 28, 2024):
The issue is in the DHCP server passing the information to old nics
In my case if you have this option
option bootfile-name "netboot.xyz.kpxe";the old nic will put some special chars on the end of it.
if you have the config has specified in the docs
you have something like this in the dhcp server
so try to remove option boot-filename if you NIC is to old.
@antonym commented on GitHub (Feb 28, 2024):
Let me know if dropping the option helps and we can get the knowledge base updated.
@BloodBlight commented on GitHub (Feb 28, 2024):
I will test later tonight and let you know.
On Wed, Feb 28, 2024, 10:17 AM Antony Messerli @.***>
wrote:
@BloodBlight commented on GitHub (Mar 1, 2024):
So, I didn't fully read through the instructions at work the other day... I am using a UniFi device for my DHCP and can't deploy a config like that. I only get the option to include a host and a file name:
https://imgur.com/a/aYicWfO
Suggestions other than a rip and replace?
@rudiservo commented on GitHub (Mar 1, 2024):
@BloodBlight does it work without TFTP server?
Unifi are great, except when you need to dig deep.
Can you ssh into the router?
@BloodBlight commented on GitHub (Mar 1, 2024):
Yeeeeesss... :) But I am not really comfortable editing their their config without the GUI's consent. That has a bad tendency to break things.
If they don't have the options, then they don't and I can work around that. Maybe have a "deployment" network that has it's own server.
I can test that with these boxes, but it will take a bit more time. Too many plates and not enough spoons to handle that one right away.
@rudiservo commented on GitHub (Mar 1, 2024):
I feel your pain.
Yes test it with the boxes
because if it does you can put a support request for unifi and hopefully they will add more options to fix it in the router GUI.
@megapearl commented on GitHub (Mar 16, 2024):
Tried to remove the boot-filename parameter, but then the iPXE client cannot find a bootfile and is not booting at all.
I got it working by replacing the DHCP server in pfSense 2.7.2-RELEASE from the new Kea one to the old isc-dhcp deprecated one.
Now booting old bios clients and new uefi clients.
@rudiservo commented on GitHub (Mar 16, 2024):
@megapearl I have OpnSense so the way PfSense and OpnSense generate the config file may be different, best way to check this is by going strait into ssh and cat the config file to check if the option is there.
Anyway it's good to know that at least in Kea generated file that issue is sort of mitigated.
IMO advisory should be added to docs about this issue and that it may differ from router firmware or software.
@eladiogalvez commented on GitHub (May 12, 2024):
Same issue with pfsense and old nic.
Fixed using deprecated dhcp server as @megapearl commented.
@gbuloz commented on GitHub (May 27, 2025):
Same issue with kea 2.6.2 on Fedora 41 when booting a 10 years old Kontron VX3040 Intel CPU board. After some debug with tcpdump I noticed an extra FF at the end of the filename requested to the TFTP server. As a workaround I've renamed the boot files on the server with an extra FF at the end of their names using : mv name.efi $(echo -en 'name.efi\xFF')
@BloodBlight commented on GitHub (May 27, 2025):
Oh, that's a great little hack! I can even script out that creation. Thank you for sharing!
@Koli0842 commented on GitHub (Jun 3, 2025):
I have also encountered this (Ubiquiti USG, and an old Z77X-UD3H with an Atheros NIC), the above hack worked. Instead of moving, I created symlinks for all bootable entities, it still works
@BloodBlight commented on GitHub (Jun 3, 2025):
As this is NOT a bug with netbootxyz, but rather an issue with with DHCP, I am open to closing this ticket. Maybe taking the notes from it and this "hack" and putting it into the docs?
@Koli0842 commented on GitHub (Jun 3, 2025):
Sounds good to me, took some digging to find this.
@bwann commented on GitHub (Aug 9, 2025):
I did a bunch of digging into this problem and reading of UEFI specs a while back and I'm pretty sure what is happening is UEFI bugs around line terminations, at least when using UEFI PXE on IPv4. This comes down to using the fixed length "file" field in the DHCP header vs using Option 67 for providing a boot filename, and how different UEFI implementations handle line and field terminations in DHCPv4 packets.
RFC 2132 does not guarantee the filename in option 67 is null terminated. In the UEFI 2.6 spec DHCP options are treated as variable length fields in the form of "option code + length of option data + option data" but the spec does not address line terminations at all, that's left as an implementation detail. So some handle the filename in option 67 correctly and some don't.
For example for several of my SuperMicro boards given only option 67 (no higher numbered options) as "testfilename", the packet will contain 0x48 (decimal 67), 0x0C (length 12), the filename, and then 0xff at the end of the packet. They should read 12 bytes and stop, but what they do is keep reading data in as the filename right to the end of the packet as if they're expecting a null terminated string and not a variable-length-field. That's what gets the junk added to the end of TFTP filenames. I demonstrated this by adding some data to option 68 so it follows next in the same packet and their UEFI PXE code kept reading in the data in option 68 as part of the TFTP filename!
The way I see to fix this is not to use option 67 when providing a boot filename, but the actual 'file' field in the DHCP header. At least in Kea this is done as providing "boot-file-name" in the top level Dhcp4 (or class) config, and not in "option-data". Or pray and complain to the vendor they fix their UEFI.
Interestingly DHCPv6 doesn't have this problem because it's all variable-length-fields. The Tianocore EDK II reference UEFI implementation also goes out of its way to call out the ambiguous line termination with Option 67 and tries to do the right thing. I have a writeup a did that contains code snippets and examples: https://binaryfury.wann.net/2024/12/pxe-two-tftp-filenames-one-dhcp-offer-plus-weird-filenames/
@antonym commented on GitHub (Aug 9, 2025):
@claude can you summarize this for a kb article for https://github.com/netbootxyz/netboot.xyz-docs
@claude[bot] commented on GitHub (Aug 9, 2025):
Claude finished @antonym's task —— View job
Creating Knowledge Base Article Summary
I've analyzed the issue thread and created a comprehensive KB article summary about TFTP filename interpretation problems.
Todo List:
KB Article: TFTP Filename Interpretation Issues with Older PXE Clients
Problem Description
Older PXE clients (typically 10+ years old) may append extra characters to TFTP filenames, causing "File not found" errors. The issue manifests as Unicode replacement characters (�) or hex bytes (often 0xFF) being added to the end of requested filenames.
Root Cause
This is a UEFI PXE implementation bug related to DHCP filename handling:
Affected Hardware/Software
Hardware:
DHCP Servers:
Working Combinations:
Workarounds and Solutions
1. Server-Side File Naming (Recommended)
Create boot files with the extra 0xFF byte in the filename:
2. DHCP Configuration Changes
For isc-dhcp servers, use the
boot-file-namedirective instead of Option 67:For pfSense users: Switch from Kea to the deprecated isc-dhcp service in System > Advanced > Networking.
3. Remove DHCP boot-filename Option
Some users report success by removing the
option bootfile-namedirective entirely, though this may break other clients.Technical Details
Troubleshooting Steps
Prevention
boot-file-namedirective in DHCP configuration instead of Option 67References