Skip to contentSkip to conversation

package/tftpd: bump to version 5.4

PATCH In review Nathan Bloch 2 participants 2 messages Aug 20 – Sep 18

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/tftpd: bump to version 5.4

Switch from a post-5.3 git snapshot back to the release tarball, now that 5.4 is out.

This also fixes a regression in the snapshot we pin: the autoconf modernization in fefaa2cc5c2a renamed the msg_control define to HAVE_STRUCT_MSGHDR_MSG_CONTROL, but tftpd/recvfrom.c kept testing for HAVE_MSGHDR_MSG_CONTROL, so the recvmsg() code path is compiled out and the fallback is used instead. That fallback reads the address family from the 'from' address before recvfrom() has filled it in, so the first request after each start creates the transfer socket with AF_UNSPEC, gets EAFNOSUPPORT and exits without answering or logging the request. Fixed upstream in 5.4 by e701714f7a8c ("autoconf: correct the new #define names after modernization") and 82223bbf9391 ("tftpd/ recvfrom.c: don't derive local address family before recvfrom()").

Drop TFTPD_AUTORECONF and its m4 include directory: the release tarball ships a configure script.

Update the license information: 5.4 replaced the per-file license preambles with SPDX tags and a LICENSES/ directory, so tftpd/tftpd.c no longer contains any license text. Both binaries are built from a mix of BSD-4-Clause-UC and BSD-3-Clause files.

Add a patch for the only build failure in 5.4: tftpd/path.h uses bool without including <stdbool.h>, which requires a C23 compiler.

Fixes d4a84e61615553ff678d3c3b52ed33f898e9fcc9
---
 ...path.h-add-missing-stdbool.h-include.patch | 39 +++++++++++++++++++
 package/tftpd/tftpd.hash                      |  9 +++--
 package/tftpd/tftpd.mk                        | 13 +++----
 3 files changed, 49 insertions(+), 12 deletions(-)
 create mode 100644 package/tftpd/0001-tftpd-path.h-add-missing-stdbool.h-include.patch
package/tftpd/0001-tftpd-path.h-add-missing-stdbool.h-include.patch new file +39 -0
new file mode 100644
index 0000000000..5995ecd937
@@ -0,0 +1,39 @@
+From: Nathan Bloch <[email protected]>
+Date: Wed, 20 Aug 2026 12:00:00 +0300
+Subject: [PATCH] tftpd/path.h: add missing <stdbool.h> include
+
+path.h declares parse_path() with a bool parameter, and both of its
+users, path.c and tftpd.c, use bool without including <stdbool.h>
+themselves. That only compiles where bool is a keyword, i.e. C23, so
+the build fails with any compiler defaulting to C17 or older:
+
+  path.h:7:43: error: unknown type name 'bool'
+  path.c:55:33: error: 'true' undeclared (first use in this function)
+  tftpd.c:391:5: error: unknown type name 'bool'
+
+gcc defaults to gnu17 up to and including 14.x, so 5.4 does not build
+with any of them.
+
+Include <stdbool.h> from path.h, the header declaring the bool-taking
+prototype, which both users already include.
+
+Upstream: not submitted yet, upstream master is affected as well.
+
+Signed-off-by: Nathan Bloch <[email protected]>
+---
+ tftpd/path.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/tftpd/path.h b/tftpd/path.h
+index 93c7269..97aacc3 100644
+--- a/tftpd/path.h
++++ b/tftpd/path.h
+@@ -4,6 +4,8 @@
+ #ifndef TFTPD_PATH_H
+ #define TFTPD_PATH_H 1
+ 
++#include <stdbool.h>
++
+ const char **parse_path(const char *path, bool strict);
+ char *build_path(const char * const *dirs);
+ unsigned int compare_paths(const char * const *a, const char * const *b);
package/tftpd/tftpd.hash +5 -4
index 5a4e87f689..4a7d6ae5ab 100644
@@ -1,5 +1,6 @@
-# Locally calculated
-sha256  452b2d630f884d80a7c4c324aa8248470224048ffb9473e3490460658b8ebea4  tftpd-2c86ff58dcc003107b47f2d35aa0fdc4a3fd95e1-git4.tar.gz
+# From https://www.kernel.org/pub/software/network/tftp/tftp-hpa/sha256sums.asc
+sha256  abef8b32fa5951bf18e0cbe07e0f0f1b25580cc24d2f9513123be5f840402c87  tftp-hpa-5.4.tar.xz
 
-# Hash for license file
-sha256  9c46847a03d4cf290616a173d526b9bbdfcaf6846cbc01f361989b4e61f2d72e  tftpd/tftpd.c
+# Locally calculated
+sha256  fc8ce700cb385e975d94ca14f0ad25b4ec2591558d15e96fc428cc63dcbfc956  LICENSES/BSD-4-Clause-UC.txt
+sha256  2c8f649586dee0d7a063bcbe46b7606c27111b29c7655a6b89797858c8eac2ed  LICENSES/BSD-3-Clause.txt
package/tftpd/tftpd.mk +5 -8
index 73ac7006a4..e8bc6c994a 100644
@@ -4,18 +4,15 @@
 #
 ################################################################################
 
-TFTPD_VERSION = 2c86ff58dcc003107b47f2d35aa0fdc4a3fd95e1
-TFTPD_SITE = https://git.kernel.org/pub/scm/network/tftp/tftp-hpa.git
-TFTPD_SITE_METHOD = git
+TFTPD_VERSION = 5.4
+TFTPD_SOURCE = tftp-hpa-$(TFTPD_VERSION).tar.xz
+TFTPD_SITE = $(BR2_KERNEL_MIRROR)/software/network/tftp/tftp-hpa
 TFTPD_CONF_OPTS = --disable-tcpwrappers
-TFTPD_LICENSE = BSD-4-Clause
-TFTPD_LICENSE_FILES = tftpd/tftpd.c
+TFTPD_LICENSE = BSD-4-Clause-UC, BSD-3-Clause
+TFTPD_LICENSE_FILES = LICENSES/BSD-4-Clause-UC.txt LICENSES/BSD-3-Clause.txt
 TFTPD_CPE_ID_VENDOR = tftpd-hpa_project
 TFTPD_CPE_ID_PRODUCT = tftpd-hpa
 TFTPD_SELINUX_MODULES = tftp
-# From git
-TFTPD_AUTORECONF = YES
-TFTPD_AUTORECONF_OPTS = --include=$(@D)/autoconf/m4
 
 define TFTPD_INSTALL_TARGET_CMDS
 	$(INSTALL) -D $(@D)/tftp/tftp $(TARGET_DIR)/usr/bin/tftp
Signature · 6 lines
2.43.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

Hello,

Thanks for the patch.

Quoted 23 lines · Nathan Bloch

Switch from a post-5.3 git snapshot back to the release tarball, now that 5.4 is out.

This also fixes a regression in the snapshot we pin: the autoconf modernization in fefaa2cc5c2a renamed the msg_control define to HAVE_STRUCT_MSGHDR_MSG_CONTROL, but tftpd/recvfrom.c kept testing for HAVE_MSGHDR_MSG_CONTROL, so the recvmsg() code path is compiled out and the fallback is used instead. That fallback reads the address family from the 'from' address before recvfrom() has filled it in, so the first request after each start creates the transfer socket with AF_UNSPEC, gets EAFNOSUPPORT and exits without answering or logging the request. Fixed upstream in 5.4 by e701714f7a8c ("autoconf: correct the new #define names after modernization") and 82223bbf9391 ("tftpd/ recvfrom.c: don't derive local address family before recvfrom()").

Drop TFTPD_AUTORECONF and its m4 include directory: the release tarball ships a configure script.

Update the license information: 5.4 replaced the per-file license preambles with SPDX tags and a LICENSES/ directory, so tftpd/tftpd.c no longer contains any license text. Both binaries are built from a mix of BSD-4-Clause-UC and BSD-3-Clause files.

Quoted 4 lines

Add a patch for the only build failure in 5.4: tftpd/path.h uses bool without including <stdbool.h>, which requires a C23 compiler.

Fixes d4a84e61615553ff678d3c3b52ed33f898e9fcc9

When you say it fixes this commit, is it because of the regression you're mentioning in the commit log?

Minor: when providing a fixes tag referring to a commit, also put the commit title:

Fixes <hash> ("<title>")

because here I was wondering whether d4a84e61615553ff678d3c3b52ed33f898e9fcc9 was a Buildroot commit reference or an autobuilder failure reference.

Quoted 16 lines
package/tftpd/0001-tftpd-path.h-add-missing-stdbool.h-include.patch new file +10 -0
new file mode 100644
index 0000000000..5995ecd937
@@ -0,0 +1,39 @@
+From: Nathan Bloch <[email protected]>
+Date: Wed, 20 Aug 2026 12:00:00 +0300
+Subject: [PATCH] tftpd/path.h: add missing <stdbool.h> include
+
+path.h declares parse_path() with a bool parameter, and both of its
+users, path.c and tftpd.c, use bool without including <stdbool.h>
+themselves. That only compiles where bool is a keyword, i.e. C23, so
+the build fails with any compiler defaulting to C17 or older:
+
+  path.h:7:43: error: unknown type name 'bool'

package/tftpd/0001-tftpd-path.h-add-missing-stdbool.h-include.patch line 20

Quoted 10 lines
package/tftpd/0001-tftpd-path.h-add-missing-stdbool.h-include.patch new file +10 -0
+  path.c:55:33: error: 'true' undeclared (first use in this function)
+  tftpd.c:391:5: error: unknown type name 'bool'
+
+gcc defaults to gnu17 up to and including 14.x, so 5.4 does not build
+with any of them.
+
+Include <stdbool.h> from path.h, the header declaring the bool-taking
+prototype, which both users already include.
+
+Upstream: not submitted yet, upstream master is affected as well.

Patches should be submitted upstream first. Turns out that I guess this issue was fixed upstream by commit 8694c57ac439db5e776ecac6ca92333dd0bf3285, which took a different approach than your patch.

Also, not your fault but since your patch, upstream has released 6.0 and 6.1 (but that's not why I didn't apply your patch, it's really because the patch had not been submitted upstream).

Could you spin a v2?

Thanks a lot!

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot