summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYi Zhao <yi.zhao@windriver.com>2026-03-31 21:10:29 +0800
committerKhem Raj <khem.raj@oss.qualcomm.com>2026-03-31 09:40:18 -0700
commit3daba3636a909bbdded106cbaf54303393e34a0e (patch)
tree1a4892c691e956888cb23cded13b98581420f628
parent743b258def026f1bbb59295c5968302097b5504d (diff)
downloadmeta-openembedded-3daba3636a909bbdded106cbaf54303393e34a0e.tar.gz
tftp-hpa: upgrade 5.2 -> 5.3
* Use git instead of tarball in SRC_URI. * Update configuration options. * Clean up and refresh local patches. Signed-off-by: Yi Zhao <yi.zhao@windriver.com> Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
-rw-r--r--meta-networking/recipes-daemons/tftp-hpa/files/0001-__progname-is-provided-by-libc.patch64
-rw-r--r--meta-networking/recipes-daemons/tftp-hpa/files/0001-tftp-Mark-toplevel-definition-as-external.patch30
-rw-r--r--meta-networking/recipes-daemons/tftp-hpa/files/0001-tftp-Remove-double-inclusion-of-signal.h.patch39
-rw-r--r--meta-networking/recipes-daemons/tftp-hpa/files/add-error-check-for-disk-filled-up.patch18
-rw-r--r--meta-networking/recipes-daemons/tftp-hpa/files/fix-writing-emtpy-file.patch13
-rw-r--r--meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.40-remap.patch2
-rw-r--r--meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.42-tftpboot.patch2
-rw-r--r--meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-chk_retcodes.patch2
-rw-r--r--meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.39-tzfix.patch2
-rw-r--r--meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-fortify-strcpy-crash.patch2
-rw-r--r--meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-stats.patch2
-rw-r--r--meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-5.2-pktinfo.patch29
-rw-r--r--meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-5.3-cmd_arg.patch (renamed from meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-cmd_arg.patch)35
-rw-r--r--meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-5.3-pktinfo.patch29
-rw-r--r--meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-bug-fix-on-separated-CR-and-LF.patch4
-rw-r--r--meta-networking/recipes-daemons/tftp-hpa/files/tftp-xinetd18
-rw-r--r--meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.3.bb (renamed from meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb)70
17 files changed, 101 insertions, 260 deletions
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/0001-__progname-is-provided-by-libc.patch b/meta-networking/recipes-daemons/tftp-hpa/files/0001-__progname-is-provided-by-libc.patch
deleted file mode 100644
index 66c15b5f8b..0000000000
--- a/meta-networking/recipes-daemons/tftp-hpa/files/0001-__progname-is-provided-by-libc.patch
+++ /dev/null
@@ -1,64 +0,0 @@
1From 941038fc05be21202cab7a7a9434097fb55ecbe0 Mon Sep 17 00:00:00 2001
2From: Thorsten Glaser <tg@mirbsd.de>
3Date: Thu, 31 Jul 2014 16:29:41 +0930
4Subject: [PATCH] __progname[] is provided by libc
5
6Rename local variable to tftpd_progname to avoid a clash with glibc
7global symbols and work around Debian bug #519006 (Closes: #564052).
8
9[ hpa: specifically, double-underscore symbols in C are reserved for
10 the implementation, i.e. compiler/libc. ]
11
12Signed-off-by: Ron Lee <ron@debian.org>
13Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
14---
15Upstream-Status: Pending
16
17 tftpd/tftpd.c | 10 +++++-----
18 1 file changed, 5 insertions(+), 5 deletions(-)
19
20diff --git a/tftpd/tftpd.c b/tftpd/tftpd.c
21index e247b97..5fec7bf 100644
22--- a/tftpd/tftpd.c
23+++ b/tftpd/tftpd.c
24@@ -76,7 +76,7 @@ static int ai_fam = AF_INET;
25 #define TRIES 6 /* Number of attempts to send each packet */
26 #define TIMEOUT_LIMIT ((1 << TRIES)-1)
27
28-const char *__progname;
29+const char *tftpd_progname;
30 static int peer;
31 static unsigned long timeout = TIMEOUT; /* Current timeout value */
32 static unsigned long rexmtval = TIMEOUT; /* Basic timeout value */
33@@ -395,9 +395,9 @@ int main(int argc, char **argv)
34 /* basename() is way too much of a pain from a portability standpoint */
35
36 p = strrchr(argv[0], '/');
37- __progname = (p && p[1]) ? p + 1 : argv[0];
38+ tftpd_progname = (p && p[1]) ? p + 1 : argv[0];
39
40- openlog(__progname, LOG_PID | LOG_NDELAY, LOG_DAEMON);
41+ openlog(tftpd_progname, LOG_PID | LOG_NDELAY, LOG_DAEMON);
42
43 srand(time(NULL) ^ getpid());
44
45@@ -946,14 +946,14 @@ int main(int argc, char **argv)
46 syslog daemon gets restarted by the time we get here. */
47 if (secure && standalone) {
48 closelog();
49- openlog(__progname, LOG_PID | LOG_NDELAY, LOG_DAEMON);
50+ openlog(tftpd_progname, LOG_PID | LOG_NDELAY, LOG_DAEMON);
51 }
52
53 #ifdef HAVE_TCPWRAPPERS
54 /* Verify if this was a legal request for us. This has to be
55 done before the chroot, while /etc is still accessible. */
56 request_init(&wrap_request,
57- RQ_DAEMON, __progname,
58+ RQ_DAEMON, tftpd_progname,
59 RQ_FILE, fd,
60 RQ_CLIENT_SIN, &from, RQ_SERVER_SIN, &myaddr, 0);
61 sock_methods(&wrap_request);
62--
632.14.1
64
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/0001-tftp-Mark-toplevel-definition-as-external.patch b/meta-networking/recipes-daemons/tftp-hpa/files/0001-tftp-Mark-toplevel-definition-as-external.patch
deleted file mode 100644
index 646757c783..0000000000
--- a/meta-networking/recipes-daemons/tftp-hpa/files/0001-tftp-Mark-toplevel-definition-as-external.patch
+++ /dev/null
@@ -1,30 +0,0 @@
1From 2a12174a5059e84d4ff6fad8f983a4d0f2127e73 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 12 Aug 2020 12:17:31 -0700
4Subject: [PATCH] tftp: Mark toplevel definition as external
5
6Fixes
7multiple definition of `toplevel'; tftp.o:/usr/src/debug/tftp-hpa/5.2-r0/tftp-hpa-5.2/tftp/tftp.c:51: first defined here
8
9Upstream-Status: Pending
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 tftp/tftp.c | 2 +-
13 1 file changed, 1 insertion(+), 1 deletion(-)
14
15diff --git a/tftp/tftp.c b/tftp/tftp.c
16index 9d15022..109848c 100644
17--- a/tftp/tftp.c
18+++ b/tftp/tftp.c
19@@ -48,7 +48,7 @@ extern int maxtimeout;
20 #define PKTSIZE SEGSIZE+4
21 char ackbuf[PKTSIZE];
22 int timeout;
23-sigjmp_buf toplevel;
24+extern sigjmp_buf toplevel;
25 sigjmp_buf timeoutbuf;
26
27 static void nak(int, const char *);
28--
292.28.0
30
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/0001-tftp-Remove-double-inclusion-of-signal.h.patch b/meta-networking/recipes-daemons/tftp-hpa/files/0001-tftp-Remove-double-inclusion-of-signal.h.patch
deleted file mode 100644
index 84658d667b..0000000000
--- a/meta-networking/recipes-daemons/tftp-hpa/files/0001-tftp-Remove-double-inclusion-of-signal.h.patch
+++ /dev/null
@@ -1,39 +0,0 @@
1From e9ed48d91642d384ce07cbb9bec788f07fc6354c Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 6 Sep 2022 14:51:42 -0700
4Subject: [PATCH] tftp: Remove double inclusion of signal.h
5
6Undefine __USE_XOPEN2K8 so we can get bsd_signal definition from system
7headers
8
9Upstream-Status: Pending
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 config.h | 4 +++-
13 1 file changed, 3 insertions(+), 1 deletion(-)
14
15diff --git a/config.h b/config.h
16index 3ff2915..ae1a14b 100644
17--- a/config.h
18+++ b/config.h
19@@ -93,7 +93,6 @@
20 #endif
21
22 #include <errno.h>
23-#include <signal.h>
24
25 #ifdef HAVE_SYS_SOCKET_H
26 #include <sys/socket.h>
27@@ -296,6 +295,9 @@ char *xstrdup(const char *);
28
29 #ifndef HAVE_BSD_SIGNAL
30 void (*bsd_signal(int, void (*)(int))) (int);
31+#else
32+#undef __USE_XOPEN2K8
33+#include <signal.h>
34 #endif
35 #ifndef HAVE_DUP2
36 int dup2(int, int);
37--
382.37.3
39
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/add-error-check-for-disk-filled-up.patch b/meta-networking/recipes-daemons/tftp-hpa/files/add-error-check-for-disk-filled-up.patch
index e4acd099ab..0f324a3265 100644
--- a/meta-networking/recipes-daemons/tftp-hpa/files/add-error-check-for-disk-filled-up.patch
+++ b/meta-networking/recipes-daemons/tftp-hpa/files/add-error-check-for-disk-filled-up.patch
@@ -1,19 +1,19 @@
1From bd5773947af5ca80ca546ad5625818fc912bdd60 Mon Sep 17 00:00:00 2001 1From 0b89c5bd9723ebd5207590016a14e5f2c6a0bdc9 Mon Sep 17 00:00:00 2001
2From: "Roy.Li" <rongqing.li@windriver.com> 2From: "Roy.Li" <rongqing.li@windriver.com>
3Date: Thu, 22 Aug 2013 08:56:09 +0800 3Date: Thu, 22 Aug 2013 08:56:09 +0800
4Subject: [PATCH] tftp-hpa: add error check for disk filled up 4Subject: [PATCH] tftp-hpa: add error check for disk filled up
5 5
6Upstream-Status: Pending [Sent to http://www.syslinux.org/archives/2013-August/020765.html]
7
8Add error check when the write-buffer is finally flushed to the file, 6Add error check when the write-buffer is finally flushed to the file,
9the caller can detect if the disk filled up (or had an i/o error) and 7the caller can detect if the disk filled up (or had an i/o error) and
10return a NOSAPCE nak to the other side. 8return a NOSAPCE nak to the other side.
11 9
10Upstream-Status: Pending [Sent to http://www.syslinux.org/archives/2013-August/020765.html]
11
12Signed-off-by: Ming Liu <ming.liu@windriver.com> 12Signed-off-by: Ming Liu <ming.liu@windriver.com>
13Signed-off-by: Roy.Li <rongqing.li@windriver.com> 13Signed-off-by: Roy.Li <rongqing.li@windriver.com>
14--- 14---
15 common/tftpsubs.c | 8 +++++--- 15 common/tftpsubs.c | 8 +++++---
16 tftpd/tftpd.c | 12 ++++++++++-- 16 tftpd/tftpd.c | 12 ++++++++++--
17 2 files changed, 15 insertions(+), 5 deletions(-) 17 2 files changed, 15 insertions(+), 5 deletions(-)
18 18
19diff --git a/common/tftpsubs.c b/common/tftpsubs.c 19diff --git a/common/tftpsubs.c b/common/tftpsubs.c
@@ -47,10 +47,10 @@ index 8c999f6..b4d4ffe 100644
47 47
48 /* When an error has occurred, it is possible that the two sides 48 /* When an error has occurred, it is possible that the two sides
49diff --git a/tftpd/tftpd.c b/tftpd/tftpd.c 49diff --git a/tftpd/tftpd.c b/tftpd/tftpd.c
50index 1873e70..c2adbda 100644 50index 3158c6d..001237b 100644
51--- a/tftpd/tftpd.c 51--- a/tftpd/tftpd.c
52+++ b/tftpd/tftpd.c 52+++ b/tftpd/tftpd.c
53@@ -1681,7 +1681,11 @@ static void tftp_recvfile(const struct formats *pf, struct tftphdr *oap, int oac 53@@ -1690,7 +1690,11 @@ static void tftp_recvfile(const struct formats *pf, struct tftphdr *oap, int oac
54 syslog(LOG_WARNING, "tftpd: write(ack): %m"); 54 syslog(LOG_WARNING, "tftpd: write(ack): %m");
55 goto abort; 55 goto abort;
56 } 56 }
@@ -63,7 +63,7 @@ index 1873e70..c2adbda 100644
63 for (;;) { 63 for (;;) {
64 n = recv_time(peer, dp, PKTSIZE, 0, &r_timeout); 64 n = recv_time(peer, dp, PKTSIZE, 0, &r_timeout);
65 if (n < 0) { /* really? */ 65 if (n < 0) { /* really? */
66@@ -1712,7 +1716,11 @@ static void tftp_recvfile(const struct formats *pf, struct tftphdr *oap, int oac 66@@ -1721,7 +1725,11 @@ static void tftp_recvfile(const struct formats *pf, struct tftphdr *oap, int oac
67 goto abort; 67 goto abort;
68 } 68 }
69 } while (size == segsize); 69 } while (size == segsize);
@@ -77,5 +77,5 @@ index 1873e70..c2adbda 100644
77 77
78 ap->th_opcode = htons((u_short) ACK); /* send the "final" ack */ 78 ap->th_opcode = htons((u_short) ACK); /* send the "final" ack */
79-- 79--
801.7.10.4 802.34.1
81 81
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/fix-writing-emtpy-file.patch b/meta-networking/recipes-daemons/tftp-hpa/files/fix-writing-emtpy-file.patch
index 4f3dcd7767..0b235361c5 100644
--- a/meta-networking/recipes-daemons/tftp-hpa/files/fix-writing-emtpy-file.patch
+++ b/meta-networking/recipes-daemons/tftp-hpa/files/fix-writing-emtpy-file.patch
@@ -1,6 +1,7 @@
1[PATCH] fix the empty file writting 1From 1ce974f1cf6afbc528c941a8cdf0817a3fd7c5a7 Mon Sep 17 00:00:00 2001
2 2From: "Roy.Li" <rongqing.li@windriver.com>
3Upstream-Status: Pending 3Date: Mon, 30 Mar 2026 22:37:22 +0800
4Subject: [PATCH] fix the empty file writting
4 5
5With the feature that checking the disk filled up, the return 6With the feature that checking the disk filled up, the return
6value of function write_behind was checked and used to detect 7value of function write_behind was checked and used to detect
@@ -11,13 +12,15 @@ error was miss-raised.
11make write_behind to return 0 if written file is empty, to fix 12make write_behind to return 0 if written file is empty, to fix
12the this bug. 13the this bug.
13 14
15Upstream-Status: Pending
16
14Signed-off-by: Roy.Li <rongqing.li@windriver.com> 17Signed-off-by: Roy.Li <rongqing.li@windriver.com>
15--- 18---
16 common/tftpsubs.c | 5 ++++- 19 common/tftpsubs.c | 5 ++++-
17 1 file changed, 4 insertions(+), 1 deletion(-) 20 1 file changed, 4 insertions(+), 1 deletion(-)
18 21
19diff --git a/common/tftpsubs.c b/common/tftpsubs.c 22diff --git a/common/tftpsubs.c b/common/tftpsubs.c
20index b4ea3f2..9f6cafc 100644 23index b4ea3f2..30e749a 100644
21--- a/common/tftpsubs.c 24--- a/common/tftpsubs.c
22+++ b/common/tftpsubs.c 25+++ b/common/tftpsubs.c
23@@ -198,9 +198,12 @@ int write_behind(FILE * file, int convert) 26@@ -198,9 +198,12 @@ int write_behind(FILE * file, int convert)
@@ -35,5 +38,5 @@ index b4ea3f2..9f6cafc 100644
35 return write(fileno(file), buf, count); 38 return write(fileno(file), buf, count);
36 39
37-- 40--
381.9.1 412.34.1
39 42
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.40-remap.patch b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.40-remap.patch
index 3f690609a6..837d2f7d08 100644
--- a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.40-remap.patch
+++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.40-remap.patch
@@ -1,6 +1,6 @@
1Patch originally from Fedora 1Patch originally from Fedora
2 2
3http://pkgs.fedoraproject.org/cgit/tftp.git/ 3https://src.fedoraproject.org/rpms/tftp.git
4 4
5Upstream-Status: Pending 5Upstream-Status: Pending
6 6
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.42-tftpboot.patch b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.42-tftpboot.patch
index 98a86b78b0..8a30194f4b 100644
--- a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.42-tftpboot.patch
+++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.42-tftpboot.patch
@@ -1,6 +1,6 @@
1Patch originally from Fedora 1Patch originally from Fedora
2 2
3http://pkgs.fedoraproject.org/cgit/tftp.git/ 3https://src.fedoraproject.org/rpms/tftp.git
4 4
5Upstream-Status: Pending 5Upstream-Status: Pending
6 6
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-chk_retcodes.patch b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-chk_retcodes.patch
index 7ae1a87220..fae887427f 100644
--- a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-chk_retcodes.patch
+++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-chk_retcodes.patch
@@ -1,6 +1,6 @@
1Patch originally from Fedora 1Patch originally from Fedora
2 2
3http://pkgs.fedoraproject.org/cgit/tftp.git/ 3https://src.fedoraproject.org/rpms/tftp.git
4 4
5Upstream-Status: Pending 5Upstream-Status: Pending
6 6
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.39-tzfix.patch b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.39-tzfix.patch
index 85110eb285..3a3a292e2e 100644
--- a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.39-tzfix.patch
+++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.39-tzfix.patch
@@ -1,6 +1,6 @@
1Patch originally from Fedora 1Patch originally from Fedora
2 2
3http://pkgs.fedoraproject.org/cgit/tftp.git/ 3https://src.fedoraproject.org/rpms/tftp.git
4 4
5Upstream-Status: Pending 5Upstream-Status: Pending
6 6
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-fortify-strcpy-crash.patch b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-fortify-strcpy-crash.patch
index 08d2b5b7d6..42fddfd0ca 100644
--- a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-fortify-strcpy-crash.patch
+++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-fortify-strcpy-crash.patch
@@ -1,6 +1,6 @@
1Patch originally from Fedora 1Patch originally from Fedora
2 2
3http://pkgs.fedoraproject.org/cgit/tftp.git/ 3https://src.fedoraproject.org/rpms/tftp.git
4 4
5Upstream-Status: Pending 5Upstream-Status: Pending
6 6
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-stats.patch b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-stats.patch
index 720cd69dec..f646ec5afe 100644
--- a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-stats.patch
+++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-stats.patch
@@ -1,6 +1,6 @@
1Patch originally from Fedora 1Patch originally from Fedora
2 2
3http://pkgs.fedoraproject.org/cgit/tftp.git/ 3https://src.fedoraproject.org/rpms/tftp.git
4 4
5Upstream-Status: Pending 5Upstream-Status: Pending
6 6
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-5.2-pktinfo.patch b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-5.2-pktinfo.patch
deleted file mode 100644
index 216349d26f..0000000000
--- a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-5.2-pktinfo.patch
+++ /dev/null
@@ -1,29 +0,0 @@
1Patch originally from Fedora
2
3http://pkgs.fedoraproject.org/cgit/tftp.git/
4
5Upstream-Status: Pending
6
7diff -up tftp-hpa-5.2/tftpd/recvfrom.c.test tftp-hpa-5.2/tftpd/recvfrom.c
8--- tftp-hpa-5.2/tftpd/recvfrom.c.test 2011-12-11 23:13:52.000000000 +0100
9+++ tftp-hpa-5.2/tftpd/recvfrom.c 2012-01-04 10:05:17.852042256 +0100
10@@ -149,16 +149,16 @@ myrecvfrom(int s, void *buf, int len, un
11
12 /* Try to enable getting the return address */
13 #ifdef IP_RECVDSTADDR
14- if (from->sa_family == AF_INET)
15+ if (from->sa_family == AF_INET || !from->sa_family)
16 setsockopt(s, IPPROTO_IP, IP_RECVDSTADDR, &on, sizeof(on));
17 #endif
18 #ifdef IP_PKTINFO
19- if (from->sa_family == AF_INET)
20+ if (from->sa_family == AF_INET || !from->sa_family)
21 setsockopt(s, IPPROTO_IP, IP_PKTINFO, &on, sizeof(on));
22 #endif
23 #ifdef HAVE_IPV6
24 #ifdef IPV6_RECVPKTINFO
25- if (from->sa_family == AF_INET6)
26+ if (from->sa_family == AF_INET6 || !from->sa_family)
27 setsockopt(s, IPPROTO_IPV6, IPV6_RECVPKTINFO, &on, sizeof(on));
28 #endif
29 #endif
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-cmd_arg.patch b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-5.3-cmd_arg.patch
index 6b8ceaaeba..3571137ce1 100644
--- a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-cmd_arg.patch
+++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-5.3-cmd_arg.patch
@@ -1,34 +1,23 @@
1Patch originally from Fedora 1Patch originally from Fedora
2 2
3http://pkgs.fedoraproject.org/cgit/tftp.git/ 3https://src.fedoraproject.org/rpms/tftp.git
4 4
5Upstream-Status: Pending 5Upstream-Status: Pending
6 6
7diff -up tftp-hpa-0.49/config.h.cmd_arg tftp-hpa-0.49/config.h 7diff -up tftp-hpa-5.3/config.h.cmd_arg tftp-hpa-5.3/config.h
8--- tftp-hpa-0.49/config.h.cmd_arg 2010-04-19 15:29:10.567331454 +0200 8--- tftp-hpa-5.3/config.h.cmd_arg 2024-05-30 00:40:13.000000000 +0200
9+++ tftp-hpa-0.49/config.h 2010-04-20 07:33:03.133232772 +0200 9+++ tftp-hpa-5.3/config.h 2025-12-26 22:27:30.933202754 +0100
10@@ -291,6 +291,7 @@ typedef int socklen_t; 10@@ -277,6 +277,7 @@ typedef int socklen_t;
11 /* Prototypes for libxtra functions */ 11 /* Prototypes for libxtra functions */
12 12
13 void *xmalloc(size_t); 13 void *xmalloc(size_t);
14+void *xrealloc(void *, size_t); 14+void *xrealloc(void *, size_t);
15 char *xstrdup(const char *); 15 char *xstrdup(const char *);
16 16
17 #ifndef HAVE_BSD_SIGNAL 17 #ifndef HAVE_SIGHANDLER_T
18diff -up tftp-hpa-0.49/configure.in.cmd_arg tftp-hpa-0.49/configure.in 18diff -up tftp-hpa-5.3/lib/xrealloc.c.cmd_arg tftp-hpa-5.3/lib/xrealloc.c
19--- tftp-hpa-0.49/configure.in.cmd_arg 2008-10-21 00:08:31.000000000 +0200 19--- tftp-hpa-5.3/lib/xrealloc.c.cmd_arg 2025-12-26 22:19:59.751870026 +0100
20+++ tftp-hpa-0.49/configure.in 2010-04-19 11:05:12.387340698 +0200 20+++ tftp-hpa-5.3/lib/xrealloc.c 2025-12-26 22:19:59.751870026 +0100
21@@ -152,6 +152,7 @@ OBJROOT=`pwd`
22
23 XTRA=false
24 PA_SEARCH_LIBS_AND_ADD(xmalloc, iberty)
25+PA_SEARCH_LIBS_AND_ADD(xrealloc, iberty)
26 PA_SEARCH_LIBS_AND_ADD(xstrdup, iberty)
27 PA_SEARCH_LIBS_AND_ADD(bsd_signal, bsd, bsdsignal)
28 PA_SEARCH_LIBS_AND_ADD(getopt_long, getopt, getopt_long)
29diff -up tftp-hpa-0.49/lib/xrealloc.c.cmd_arg tftp-hpa-0.49/lib/xrealloc.c
30--- tftp-hpa-0.49/lib/xrealloc.c.cmd_arg 2010-04-19 11:05:12.387340698 +0200
31+++ tftp-hpa-0.49/lib/xrealloc.c 2010-04-19 11:05:12.387340698 +0200
32@@ -0,0 +1,20 @@ 21@@ -0,0 +1,20 @@
33+/* 22+/*
34+ * xrealloc.c 23+ * xrealloc.c
@@ -50,9 +39,9 @@ diff -up tftp-hpa-0.49/lib/xrealloc.c.cmd_arg tftp-hpa-0.49/lib/xrealloc.c
50+ 39+
51+ return p; 40+ return p;
52+} 41+}
53diff -up tftp-hpa-0.49/tftp/main.c.cmd_arg tftp-hpa-0.49/tftp/main.c 42diff -up tftp-hpa-5.3/tftp/main.c.cmd_arg tftp-hpa-5.3/tftp/main.c
54--- tftp-hpa-0.49/tftp/main.c.cmd_arg 2008-10-21 00:08:31.000000000 +0200 43--- tftp-hpa-5.3/tftp/main.c.cmd_arg 2024-05-30 00:40:13.000000000 +0200
55+++ tftp-hpa-0.49/tftp/main.c 2010-04-19 11:05:12.389329337 +0200 44+++ tftp-hpa-5.3/tftp/main.c 2025-12-26 22:19:59.752870023 +0100
56@@ -89,11 +89,14 @@ int connected; 45@@ -89,11 +89,14 @@ int connected;
57 const struct modes *mode; 46 const struct modes *mode;
58 #ifdef WITH_READLINE 47 #ifdef WITH_READLINE
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-5.3-pktinfo.patch b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-5.3-pktinfo.patch
new file mode 100644
index 0000000000..02e88aed36
--- /dev/null
+++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-5.3-pktinfo.patch
@@ -0,0 +1,29 @@
1Patch originally from Fedora
2
3https://src.fedoraproject.org/rpms/tftp.git
4
5Upstream-Status: Pending
6
7diff -up tftp-hpa-5.3/tftpd/recvfrom.c.pktinfo tftp-hpa-5.3/tftpd/recvfrom.c
8--- tftp-hpa-5.3/tftpd/recvfrom.c.pktinfo 2024-05-30 00:40:13.000000000 +0200
9+++ tftp-hpa-5.3/tftpd/recvfrom.c 2025-12-26 22:30:37.142522362 +0100
10@@ -170,16 +170,16 @@ myrecvfrom(int s, void *buf, int len, un
11
12 /* Try to enable getting the return address */
13 #ifdef IP_RECVDSTADDR
14- if (from->sa.sa_family == AF_INET)
15+ if (from->sa.sa_family == AF_INET || !from->sa.sa_family)
16 setsockopt(s, IPPROTO_IP, IP_RECVDSTADDR, &on, sizeof(on));
17 #endif
18 #ifdef IP_PKTINFO
19- if (from->sa.sa_family == AF_INET)
20+ if (from->sa.sa_family == AF_INET || !from->sa.sa_family)
21 setsockopt(s, IPPROTO_IP, IP_PKTINFO, &on, sizeof(on));
22 #endif
23 #ifdef HAVE_IPV6
24 #ifdef IPV6_RECVPKTINFO
25- if (from->sa.sa_family == AF_INET6)
26+ if (from->sa.sa_family == AF_INET6 || !from->sa.sa_family)
27 setsockopt(s, IPPROTO_IPV6, IPV6_RECVPKTINFO, &on, sizeof(on));
28 #endif
29 #endif
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-bug-fix-on-separated-CR-and-LF.patch b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-bug-fix-on-separated-CR-and-LF.patch
index e994f28402..f68e6369c4 100644
--- a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-bug-fix-on-separated-CR-and-LF.patch
+++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-bug-fix-on-separated-CR-and-LF.patch
@@ -1,4 +1,4 @@
1From 6ed1eb8829dee351b54e183bc42c007cb306aaa5 Mon Sep 17 00:00:00 2001 1From 2be04543d790d9ec29fa8522f07f221468ccd033 Mon Sep 17 00:00:00 2001
2From: Zhang Xiao <xiao.zhang@windriver.com> 2From: Zhang Xiao <xiao.zhang@windriver.com>
3Date: Wed, 11 Jun 2014 14:01:16 +0800 3Date: Wed, 11 Jun 2014 14:01:16 +0800
4Subject: [PATCH] tftp-hpa: bug fix on separated CR and LF 4Subject: [PATCH] tftp-hpa: bug fix on separated CR and LF
@@ -34,5 +34,5 @@ index b4d4ffe..b4ea3f2 100644
34 c = *p++; /* pick up a character */ 34 c = *p++; /* pick up a character */
35 if (prevchar == '\r') { /* if prev char was cr */ 35 if (prevchar == '\r') { /* if prev char was cr */
36-- 36--
371.8.5.2.233.g932f7e4 372.34.1
38 38
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-xinetd b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-xinetd
deleted file mode 100644
index fe70163966..0000000000
--- a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-xinetd
+++ /dev/null
@@ -1,18 +0,0 @@
1# default: off
2# description: The tftp server serves files using the trivial file transfer \
3# protocol. The tftp protocol is often used to boot diskless \
4# workstations, download configuration files to network-aware printers, \
5# and to start the installation process for some operating systems.
6service tftp
7{
8 socket_type = dgram
9 protocol = udp
10 wait = yes
11 user = root
12 server = /usr/sbin/in.tftpd-hpa
13 server_args = -s /var/lib/tftpboot
14 disable = yes
15 per_source = 11
16 cps = 100 2
17 flags = IPv6
18}
diff --git a/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb b/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.3.bb
index 96c9bdb653..fc7e54a160 100644
--- a/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb
+++ b/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.3.bb
@@ -5,51 +5,47 @@ booting diskless workstations. The tftp package provides the user \
5interface for TFTP, which allows users to transfer files to and from a \ 5interface for TFTP, which allows users to transfer files to and from a \
6remote machine. This program and TFTP provide very little security, \ 6remote machine. This program and TFTP provide very little security, \
7and should not be enabled unless it is expressly needed." 7and should not be enabled unless it is expressly needed."
8DEPENDS = "readline" 8HOMEPAGE = "https://git.kernel.org/pub/scm/network/tftp/tftp-hpa.git/"
9SECTION = "net" 9SECTION = "net"
10HOMEPAGE = "http://freecode.com/projects/tftp-hpa"
11LICENSE = "BSD-4-Clause" 10LICENSE = "BSD-4-Clause"
12LIC_FILES_CHKSUM = "file://MCONFIG.in;beginline=1;endline=9;md5=c28ba5adb43041fae4629db05c83cbdd \ 11LIC_FILES_CHKSUM = "file://MCONFIG.in;beginline=1;endline=9;md5=c28ba5adb43041fae4629db05c83cbdd \
13 file://tftp/tftp.c;beginline=1;endline=32;md5=988c1cba99d70858a26cd877209857f4" 12 file://tftp/tftp.c;beginline=1;endline=32;md5=988c1cba99d70858a26cd877209857f4"
14 13
15 14
16SRC_URI = "http://kernel.org/pub/software/network/tftp/tftp-hpa/tftp-hpa-${PV}.tar.bz2 \ 15SRC_URI = "git://git.kernel.org/pub/scm/network/tftp/tftp-hpa.git;protocol=https;branch=master;tag=tftp-hpa-${PV} \
17 file://tftp-0.40-remap.patch \ 16 file://tftp-0.40-remap.patch \
18 file://tftp-0.42-tftpboot.patch \ 17 file://tftp-0.42-tftpboot.patch \
19 file://tftp-0.49-chk_retcodes.patch \ 18 file://tftp-0.49-chk_retcodes.patch \
20 file://tftp-0.49-cmd_arg.patch \ 19 file://tftp-hpa-5.3-cmd_arg.patch \
21 file://tftp-hpa-0.39-tzfix.patch \ 20 file://tftp-hpa-0.39-tzfix.patch \
22 file://tftp-hpa-0.49-fortify-strcpy-crash.patch \ 21 file://tftp-hpa-0.49-fortify-strcpy-crash.patch \
23 file://tftp-hpa-0.49-stats.patch \ 22 file://tftp-hpa-0.49-stats.patch \
24 file://tftp-hpa-5.2-pktinfo.patch \ 23 file://tftp-hpa-5.3-pktinfo.patch \
25 file://default \
26 file://init \
27 file://add-error-check-for-disk-filled-up.patch \ 24 file://add-error-check-for-disk-filled-up.patch \
28 file://tftp-hpa-bug-fix-on-separated-CR-and-LF.patch \ 25 file://tftp-hpa-bug-fix-on-separated-CR-and-LF.patch \
29 file://fix-writing-emtpy-file.patch \ 26 file://fix-writing-emtpy-file.patch \
30 file://0001-__progname-is-provided-by-libc.patch \ 27 file://default \
31 file://0001-tftp-Mark-toplevel-definition-as-external.patch \ 28 file://init \
32 file://0001-tftp-Remove-double-inclusion-of-signal.h.patch \
33 file://tftpd-hpa.socket \ 29 file://tftpd-hpa.socket \
34 file://tftpd-hpa.service \ 30 file://tftpd-hpa.service \
35" 31 "
36 32
37SRC_URI[md5sum] = "46c9bd20bbffa62f79c958c7b99aac21" 33SRCREV = "15c4f369ee741e9205dc28ce631aaf6799193b04"
38SRC_URI[sha256sum] = "0a9f88d4c1c02687b4853b02ab5dd8779d4de4ffdb9b2e5c9332841304d1a269"
39 34
40inherit autotools-brokensep update-rc.d update-alternatives systemd 35inherit autotools-brokensep update-rc.d update-alternatives systemd
41 36
42export AR = "${HOST_PREFIX}ar cq" 37DEPENDS = "readline"
43 38
44EXTRA_OECONF += "--disable-option-checking" 39EXTRA_OECONF = "--enable-largefile \
40 --enable-year2038 \
41 --with-readline \
42 --without-tcpwrappers \
43 "
45 44
46PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}" 45PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
47PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," 46PACKAGECONFIG[ipv6] = "--with-ipv6,--without-ipv6,"
48 47
49# configure.in has errors 48CACHED_CONFIGUREVARS:libc-musl = "ac_cv_type_socklen_t=yes"
50do_configure() {
51 oe_runconf
52}
53 49
54do_install() { 50do_install() {
55 oe_runmake install INSTALLROOT=${D} 51 oe_runmake install INSTALLROOT=${D}
@@ -57,20 +53,25 @@ do_install() {
57 mv ${D}${sbindir}/in.tftpd ${D}${sbindir}/in.tftpd-hpa 53 mv ${D}${sbindir}/in.tftpd ${D}${sbindir}/in.tftpd-hpa
58 54
59 install -m 755 -d ${D}${localstatedir}/lib/tftpboot/ 55 install -m 755 -d ${D}${localstatedir}/lib/tftpboot/
60 install -d ${D}${sysconfdir}/init.d 56
61 install -m 0755 ${UNPACKDIR}/init ${D}${sysconfdir}/init.d/tftpd-hpa 57 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
62 sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/tftpd-hpa 58 install -d ${D}${sysconfdir}/default
63 sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/tftpd-hpa 59 install -m 0644 ${UNPACKDIR}/default ${D}${sysconfdir}/default/tftpd-hpa
64 sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/tftpd-hpa 60
65 sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/tftpd-hpa 61 install -d ${D}${sysconfdir}/init.d
66 62 install -m 0755 ${UNPACKDIR}/init ${D}${sysconfdir}/init.d/tftpd-hpa
67 install -d ${D}${sysconfdir}/default 63 sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/tftpd-hpa
68 install -m 0644 ${UNPACKDIR}/default ${D}${sysconfdir}/default/tftpd-hpa 64 sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/tftpd-hpa
69 65 sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/tftpd-hpa
70 install -d ${D}${systemd_unitdir}/system 66 sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/tftpd-hpa
71 install -m 0644 ${UNPACKDIR}/tftpd-hpa.socket ${D}${systemd_unitdir}/system 67 fi
72 install -m 0644 ${UNPACKDIR}/tftpd-hpa.service ${D}${systemd_unitdir}/system 68
73 sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/tftpd-hpa.service 69 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
70 install -d ${D}${systemd_unitdir}/system
71 install -m 0644 ${UNPACKDIR}/tftpd-hpa.socket ${D}${systemd_unitdir}/system
72 install -m 0644 ${UNPACKDIR}/tftpd-hpa.service ${D}${systemd_unitdir}/system
73 sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/tftpd-hpa.service
74 fi
74} 75}
75 76
76FILES:${PN} = "${bindir}" 77FILES:${PN} = "${bindir}"
@@ -92,7 +93,6 @@ ALTERNATIVE:${PN} = "tftp"
92ALTERNATIVE_TARGET[tftp] = "${bindir}/tftp-hpa" 93ALTERNATIVE_TARGET[tftp] = "${bindir}/tftp-hpa"
93ALTERNATIVE_PRIORITY = "100" 94ALTERNATIVE_PRIORITY = "100"
94 95
95
96SYSTEMD_PACKAGES = "tftp-hpa-server" 96SYSTEMD_PACKAGES = "tftp-hpa-server"
97SYSTEMD_SERVICE:tftp-hpa-server = "tftpd-hpa.socket tftpd-hpa.service" 97SYSTEMD_SERVICE:tftp-hpa-server = "tftpd-hpa.socket tftpd-hpa.service"
98SYSTEMD_AUTO_ENABLE:tftp-hpa-server = "enable" 98SYSTEMD_AUTO_ENABLE:tftp-hpa-server = "enable"