public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/tftp] rawhide: rebase to the latest upstream release
Date: Tue, 08 Sep 2026 10:49:20 GMT [thread overview]
Message-ID: <178886456012.1.7405682424623179530.rpms-tftp-b2788cd12c6c@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/tftp
Branch : rawhide
Commit : b2788cd12c6c2d787192c0a496ed0cd7fb339ea2
Author : Lukáš Zaoral <lzaoral@redhat.com>
Date : 2026-09-08T12:01:24+02:00
Stats : +302/-332 in 9 file(s)
URL : https://src.fedoraproject.org/rpms/tftp/c/b2788cd12c6c2d787192c0a496ed0cd7fb339ea2?branch=rawhide
Log:
rebase to the latest upstream release
Resolves: rhbz#2529277
---
diff --git a/.gitignore b/.gitignore
index 20f5e37..a773a32 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,3 +6,5 @@ tftp-hpa-0.49.tar.bz2
/tftp-hpa-5.4.tar.sign
/tftp-hpa-6.0.tar.gz
/tftp-hpa-6.0.tar.sign
+/tftp-hpa-6.1.tar.gz
+/tftp-hpa-6.1.tar.sign
diff --git a/sources b/sources
index 38914a2..6e9deca 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-SHA512 (tftp-hpa-6.0.tar.gz) = 85620c5ce5b7fdeb074a0093c640ace941954189328c2a42b0339b74007767221567240731a15d529c5308c868f03fe9464f9ce6a666932fb738d3ed153dd66f
-SHA512 (tftp-hpa-6.0.tar.sign) = 697595d1ef3bb114b9acc4a95950e4244fb6375a6b97ba0604946a97cc2e4c72be8c7d68040d9d1424ef0fc53aef1d6ae440e7149deb59ec124ddf1e135b9103
+SHA512 (tftp-hpa-6.1.tar.gz) = e6901af35a98f21ba270cff8870fd41f4151f1521aa7e5d38b0cfd9d6f0ab1221f822c76614e8771423b114dfcefd48c802454cf3eef174a075ebd69e757a032
+SHA512 (tftp-hpa-6.1.tar.sign) = 3f1653439f28ccb948a49a3445eb1beb65a3e8fab7d22d55663b6d90d4ccf84855f97cb6d2731f664755cffaaa5e17db52a81967f40cac985f4fd44de57bc281
diff --git a/tftp-enhanced-logging.patch b/tftp-enhanced-logging.patch
index f47c406..71f6e96 100644
--- a/tftp-enhanced-logging.patch
+++ b/tftp-enhanced-logging.patch
@@ -1,8 +1,8 @@
diff --git a/tftpd/tftpd.c b/tftpd/tftpd.c
-index 9c1d195..98f7950 100644
+index aaf1f9c..b8ef4f4 100644
--- a/tftpd/tftpd.c
+++ b/tftpd/tftpd.c
-@@ -1026,7 +1026,7 @@ int main(int argc, char **argv)
+@@ -1059,7 +1059,7 @@ int main(int argc, char **argv)
static char *rewrite_access(const struct formats *,
char *, int, int, const char **);
static int validate_access(char *, int, const struct formats *, const char **);
@@ -11,7 +11,7 @@ index 9c1d195..98f7950 100644
static void tftp_recvfile(const struct formats *, struct tftphdr *, int);
static const struct formats formats[] = {
-@@ -1119,6 +1119,9 @@ int tftp(struct tftphdr *tp, int size)
+@@ -1152,6 +1152,9 @@ static int tftp(struct tftphdr *tp, int size)
if (!file) {
ecode =
(*pf->f_validate) (filename, tp_opcode, pf, &errmsgptr);
@@ -21,7 +21,7 @@ index 9c1d195..98f7950 100644
if (ecode) {
nak(ecode, errmsgptr);
exit(0);
-@@ -1145,12 +1148,12 @@ int tftp(struct tftphdr *tp, int size)
+@@ -1178,12 +1181,12 @@ static int tftp(struct tftphdr *tp, int size)
if (tp_opcode == WRQ)
(*pf->f_recv) (pf, (struct tftphdr *)ackbuf, ap - ackbuf);
else
@@ -36,45 +36,33 @@ index 9c1d195..98f7950 100644
}
exit(0); /* Request completed */
}
-@@ -1672,7 +1675,7 @@ static int validate_access(char *filename, int mode,
+@@ -1716,7 +1719,7 @@ static int validate_access(char *filename, int mode,
/*
* Send the requested file.
*/
-static void tftp_sendfile(const struct formats *pf, struct tftphdr *oap, int oacklen)
+static void tftp_sendfile(const struct formats *pf, struct tftphdr *oap, int oacklen, char *filename)
{
- struct tftphdr *dp;
struct tftphdr *ap; /* ack packet */
-@@ -1783,6 +1786,13 @@ static void tftp_sendfile(const struct formats *pf, struct tftphdr *oap, int oac
- break;
- }
- }
-+ tmp_p = (char *)inet_ntop(from.sa.sa_family, SOCKADDR_P(&from),
-+ tmpbuf, INET6_ADDRSTRLEN);
-+ if (!tmp_p) {
+ uint16_t ap_opcode, ap_block;
+@@ -1790,6 +1793,15 @@ static void tftp_sendfile(const struct formats *pf, struct tftphdr *oap, int oac
+ errno = result.error;
+ tftpd_log(LOG_WARNING, "tftpd: read(ack): %m");
+ break;
++ case TFTP_XFER_OK:
++ tmp_p = (char *)inet_ntop(from.sa.sa_family, SOCKADDR_P(&from),
++ tmpbuf, INET6_ADDRSTRLEN);
++ if (!tmp_p) {
+ tmp_p = tmpbuf;
+ strcpy(tmpbuf, "???");
-+ }
-+ tftpd_log(LOG_NOTICE, "Client %s finished %s", tmp_p, filename);
- abort:
- tftpio_stop(io);
- io = NULL;
-@@ -1856,6 +1866,13 @@ static void tftp_sendfile(const struct formats *pf, struct tftphdr *oap, int oac
- xfree(packets);
- xfree(lengths);
++ }
++ tftpd_log(LOG_NOTICE, "Client %s finished %s", tmp_p, filename);
++ break;
+ default:
+ break;
}
-+ tmp_p = (char *)inet_ntop(from.sa.sa_family, SOCKADDR_P(&from),
-+ tmpbuf, INET6_ADDRSTRLEN);
-+ if (!tmp_p) {
-+ tmp_p = tmpbuf;
-+ strcpy(tmpbuf, "???");
-+ }
-+ tftpd_log(LOG_NOTICE, "Client %s finished %s", tmp_p, filename);
- abort:
- (void)fclose(file);
- #endif
diff --git a/tftpd/tftpd.h b/tftpd/tftpd.h
-index b6658d4..a52adc5 100644
+index 3727ba4..4626a55 100644
--- a/tftpd/tftpd.h
+++ b/tftpd/tftpd.h
@@ -34,7 +34,7 @@ struct formats {
@@ -84,5 +72,8 @@ index b6658d4..a52adc5 100644
- void (*f_send) (const struct formats *, struct tftphdr *, int);
+ void (*f_send) (const struct formats *, struct tftphdr *, int, char *);
void (*f_recv) (const struct formats *, struct tftphdr *, int);
- int f_convert;
+ bool f_convert;
};
+--
+2.55.0
+
diff --git a/tftp-hpa-5.2-osh.patch b/tftp-hpa-5.2-osh.patch
index 460b5a8..3296a45 100644
--- a/tftp-hpa-5.2-osh.patch
+++ b/tftp-hpa-5.2-osh.patch
@@ -1,9 +1,9 @@
# Fix leaked_handle: Handle variable "fd" going out of scope leaks the handle.
diff --git a/tftpd/tftpd.c b/tftpd/tftpd.c
-index 98f7950..b3fd06c 100644
+index b8ef4f4..bfe9323 100644
--- a/tftpd/tftpd.c
+++ b/tftpd/tftpd.c
-@@ -1636,6 +1636,7 @@ static int validate_access(char *filename, int mode,
+@@ -1680,6 +1680,7 @@ static int validate_access(char *filename, int mode,
if (mode == RRQ) {
if (!unixperms && (stbuf.st_mode & (S_IREAD >> 6)) == 0) {
@@ -11,7 +11,7 @@ index 98f7950..b3fd06c 100644
*errmsg = "File must have global read permissions";
return (EACCESS);
}
-@@ -1645,6 +1646,7 @@ static int validate_access(char *filename, int mode,
+@@ -1689,6 +1690,7 @@ static int validate_access(char *filename, int mode,
} else {
if (!unixperms) {
if ((stbuf.st_mode & (S_IWRITE >> 6)) == 0) {
@@ -19,7 +19,7 @@ index 98f7950..b3fd06c 100644
*errmsg = "File must have global write permissions";
return (EACCESS);
}
-@@ -1653,6 +1655,7 @@ static int validate_access(char *filename, int mode,
+@@ -1697,6 +1699,7 @@ static int validate_access(char *filename, int mode,
#ifdef HAVE_FTRUNCATE
/* We didn't get to truncate the file at open() time */
if (ftruncate(fd, (off_t) 0)) {
diff --git a/tftp-hpa-5.3-tftp-exit-code-cmdmode.patch b/tftp-hpa-5.3-tftp-exit-code-cmdmode.patch
index 8ab101b..83d0eb4 100644
--- a/tftp-hpa-5.3-tftp-exit-code-cmdmode.patch
+++ b/tftp-hpa-5.3-tftp-exit-code-cmdmode.patch
@@ -5,9 +5,9 @@ Subject: [PATCH] tftp: propagate errors to exit code in single command mode
---
tftp/extern.h | 4 +-
- tftp/main.c | 144 ++++++++++++++++++++++++++++----------------------
- tftp/tftp.c | 37 +++++++++++--
- 3 files changed, 115 insertions(+), 70 deletions(-)
+ tftp/main.c | 152 ++++++++++++++++++++++++++++----------------------
+ tftp/tftp.c | 42 +++++++++++---
+ 3 files changed, 122 insertions(+), 76 deletions(-)
diff --git a/tftp/extern.h b/tftp/extern.h
index 7740cb7..295b8e9 100644
@@ -25,49 +25,51 @@ index 7740cb7..295b8e9 100644
#endif
diff --git a/tftp/main.c b/tftp/main.c
-index d895a30..e8900ef 100644
+index 1b618b1..bbcab02 100644
--- a/tftp/main.c
+++ b/tftp/main.c
-@@ -82,22 +82,22 @@ unsigned int portrange_to = 0;
+@@ -84,23 +84,23 @@ static unsigned int portrange_to = 0;
unsigned int blocksize = SEGSIZE;
unsigned int windowsize;
--void get(int, char **);
--void help(int, char **);
--void modecmd(int, char **);
--void put(int, char **);
--void quit(int, char **);
--void setascii(int, char **);
--void setbinary(int, char **);
--void setblocksize(int, char **);
--void setpeer(int, char **);
--void setrexmt(int, char **);
--void settimeout(int, char **);
--void settrace(int, char **);
--void setverbose(int, char **);
--void status(int, char **);
--void setliteral(int, char **);
--void setwindowsize(int, char **);
-+int get(int, char **);
-+int help(int, char **);
-+int modecmd(int, char **);
-+int put(int, char **);
-+int quit(int, char **);
-+int setascii(int, char **);
-+int setbinary(int, char **);
-+int setblocksize(int, char **);
-+int setpeer(int, char **);
-+int setrexmt(int, char **);
-+int settimeout(int, char **);
-+int settrace(int, char **);
-+int setverbose(int, char **);
-+int status(int, char **);
-+int setliteral(int, char **);
-+int setwindowsize(int, char **);
+-static void get(int, char **);
+-static void help(int, char **);
+-static void modecmd(int, char **);
+-static void put(int, char **);
+-static void quit(int, char **);
+-static void setascii(int, char **);
+-static void setbinary(int, char **);
+-static void setblocksize(int, char **);
+-static void setpeer(int, char **);
+-static void setrexmt(int, char **);
+-static void settimeout(int, char **);
+-static void settrace(int, char **);
+-static void set_verbosity(const char *, bool);
+-static void setverbose(int, char **);
+-static void status(int, char **);
+-static void setliteral(int, char **);
+-static void setwindowsize(int, char **);
++static int get(int, char **);
++static int help(int, char **);
++static int modecmd(int, char **);
++static int put(int, char **);
++static int quit(int, char **);
++static int setascii(int, char **);
++static int setbinary(int, char **);
++static int setblocksize(int, char **);
++static int setpeer(int, char **);
++static int setrexmt(int, char **);
++static int settimeout(int, char **);
++static int settrace(int, char **);
++static int set_verbosity(const char *, bool);
++static int setverbose(int, char **);
++static int status(int, char **);
++static int setliteral(int, char **);
++static int setwindowsize(int, char **);
static void command(void);
-@@ -113,7 +113,7 @@ static void settftpmode(const struct modes *);
+@@ -116,7 +116,7 @@ static void settftpmode(const struct modes *);
struct cmd {
const char *name;
const char *help;
@@ -76,16 +78,16 @@ index d895a30..e8900ef 100644
};
static const struct cmd cmdtab[] = {
-@@ -243,7 +243,7 @@ static const char short_options[] = "+46vVlm:cR:B:W:w:h";
+@@ -246,7 +246,7 @@ static const char short_options[] = "+46vVlm:cR:B:W:w:abh";
int main(int argc, char *argv[])
{
union sock_addr sa;
- int optc;
+ int optc, ret;
static int pargc, peerargc;
- static int iscmd = 0;
+ static bool iscmd;
static char **pargv;
-@@ -418,9 +418,9 @@ int main(int argc, char *argv[])
+@@ -428,9 +428,9 @@ int main(int argc, char *argv[])
if (sigsetjmp(toplevel, 1) != 0)
exit(EX_UNAVAILABLE);
@@ -97,16 +99,16 @@ index d895a30..e8900ef 100644
}
#ifdef WITH_READLINE
#ifdef HAVE_READLINE_HISTORY_H
-@@ -475,7 +475,7 @@ static void getmoreargs(const char *partial, const char *mprompt)
+@@ -485,7 +485,7 @@ static void getmoreargs(const char *partial, const char *mprompt)
#endif
}
--void setpeer(int argc, char *argv[])
-+int setpeer(int argc, char *argv[])
+-static void setpeer(int argc, char *argv[])
++static int setpeer(int argc, char *argv[])
{
int err;
-@@ -487,7 +487,7 @@ void setpeer(int argc, char *argv[])
+@@ -497,7 +497,7 @@ static void setpeer(int argc, char *argv[])
}
if ((argc < 2) || (argc > 3)) {
printf("usage: %s host-name [port]\n", argv[0]);
@@ -115,33 +117,33 @@ index d895a30..e8900ef 100644
}
peeraddr.sa.sa_family = ai_fam;
-@@ -496,7 +496,7 @@ void setpeer(int argc, char *argv[])
+@@ -506,7 +506,7 @@ static void setpeer(int argc, char *argv[])
printf("Error: %s\n", gai_strerror(err));
printf("%s: unknown host\n", argv[1]);
- connected = 0;
+ connected = false;
- return;
+ return EX_NOHOST;
}
ai_fam = peeraddr.sa.sa_family;
if (f == -1) { /* socket not open */
-@@ -533,7 +533,7 @@ void setpeer(int argc, char *argv[])
+@@ -543,7 +543,7 @@ static void setpeer(int argc, char *argv[])
if (*ep || myport > 65535UL) {
printf("%s: bad port number\n", argv[2]);
- connected = 0;
+ connected = false;
- return;
+ return EX_USAGE;
}
- port = htons((u_short) myport);
+ port = htons((uint16_t) myport);
}
-@@ -549,16 +549,17 @@ void setpeer(int argc, char *argv[])
+@@ -560,16 +560,17 @@ static void setpeer(int argc, char *argv[])
hostname, tp, (unsigned int)ntohs(port));
}
- connected = 1;
+ connected = true;
+ return 0;
}
--void modecmd(int argc, char *argv[])
-+int modecmd(int argc, char *argv[])
+-static void modecmd(int argc, char *argv[])
++static int modecmd(int argc, char *argv[])
{
const struct modes *p;
const char *sep;
@@ -153,7 +155,7 @@ index d895a30..e8900ef 100644
}
if (argc == 2) {
for (p = modes; p->m_name; p++)
-@@ -566,7 +567,7 @@ void modecmd(int argc, char *argv[])
+@@ -577,7 +578,7 @@ static void modecmd(int argc, char *argv[])
break;
if (p->m_name) {
settftpmode(p);
@@ -162,7 +164,7 @@ index d895a30..e8900ef 100644
}
printf("%s: unknown mode\n", argv[1]);
/* drop through and print usage message */
-@@ -580,21 +581,23 @@ void modecmd(int argc, char *argv[])
+@@ -591,21 +592,23 @@ static void modecmd(int argc, char *argv[])
sep = " | ";
}
printf(" ]\n");
@@ -170,8 +172,8 @@ index d895a30..e8900ef 100644
+ return EX_USAGE;
}
--void setbinary(int argc, char *argv[])
-+int setbinary(int argc, char *argv[])
+-static void setbinary(int argc, char *argv[])
++static int setbinary(int argc, char *argv[])
{
(void)argc;
(void)argv; /* Quiet unused warning */
@@ -179,8 +181,8 @@ index d895a30..e8900ef 100644
+ return 0;
}
--void setascii(int argc, char *argv[])
-+int setascii(int argc, char *argv[])
+-static void setascii(int argc, char *argv[])
++static int setascii(int argc, char *argv[])
{
(void)argc;
(void)argv; /* Quiet unused warning */
@@ -189,16 +191,16 @@ index d895a30..e8900ef 100644
}
static void settftpmode(const struct modes *newmode)
-@@ -607,7 +610,7 @@ static void settftpmode(const struct modes *newmode)
+@@ -618,7 +621,7 @@ static void settftpmode(const struct modes *newmode)
/*
* Send file(s).
*/
--void put(int argc, char *argv[])
-+int put(int argc, char *argv[])
+-static void put(int argc, char *argv[])
++static int put(int argc, char *argv[])
{
int fd;
int n, err;
-@@ -621,14 +624,14 @@ void put(int argc, char *argv[])
+@@ -633,14 +636,14 @@ static void put(int argc, char *argv[])
}
if (argc < 2) {
putusage(argv[0]);
@@ -215,15 +217,15 @@ index d895a30..e8900ef 100644
}
cp = argv[argc - 1];
targ = strchr(cp, ':');
-@@ -639,14 +642,14 @@ void put(int argc, char *argv[])
+@@ -651,14 +654,14 @@ static void put(int argc, char *argv[])
printf("Error: %s\n", gai_strerror(err));
printf("%s: unknown host\n", argv[1]);
- connected = 0;
+ connected = false;
- return;
+ return EX_NOHOST;
}
ai_fam = peeraddr.sa.sa_family;
- connected = 1;
+ connected = true;
}
if (!connected) {
printf("No target machine specified.\n");
@@ -232,7 +234,7 @@ index d895a30..e8900ef 100644
}
if (argc < 4) {
cp = argc == 2 ? tail(targ) : argv[1];
-@@ -654,17 +657,18 @@ void put(int argc, char *argv[])
+@@ -666,17 +669,18 @@ static void put(int argc, char *argv[])
if (fd < 0) {
fprintf(stderr, "tftp: ");
perror(cp);
@@ -254,7 +256,7 @@ index d895a30..e8900ef 100644
for (n = 1; n < argc - 1; n++) {
const char *base = tail(argv[n]);
char *remotepath = xmalloc(strlen(targ) + 1 + strlen(base) + 1);
-@@ -674,6 +678,7 @@ void put(int argc, char *argv[])
+@@ -686,6 +690,7 @@ static void put(int argc, char *argv[])
if (fd < 0) {
fprintf(stderr, "tftp: ");
perror(argv[n]);
@@ -262,7 +264,7 @@ index d895a30..e8900ef 100644
free(remotepath);
continue;
}
-@@ -681,9 +686,11 @@ void put(int argc, char *argv[])
+@@ -693,9 +698,11 @@ static void put(int argc, char *argv[])
printf("putting %s to %s:%s [%s]\n",
argv[n], hostname, remotepath, mode->m_mode);
sa_set_port(&peeraddr, port);
@@ -274,13 +276,13 @@ index d895a30..e8900ef 100644
+ return err;
}
- static void putusage(char *s)
-@@ -695,10 +702,10 @@ static void putusage(char *s)
+ static void putusage(const char *s)
+@@ -707,10 +714,10 @@ static void putusage(const char *s)
/*
* Receive file(s).
*/
--void get(int argc, char *argv[])
-+int get(int argc, char *argv[])
+-static void get(int argc, char *argv[])
++static int get(int argc, char *argv[])
{
int fd;
- int n;
@@ -288,7 +290,7 @@ index d895a30..e8900ef 100644
char *cp;
char *src;
-@@ -710,28 +717,28 @@ void get(int argc, char *argv[])
+@@ -722,28 +729,28 @@ static void get(int argc, char *argv[])
}
if (argc < 2) {
getusage(argv[0]);
@@ -321,7 +323,7 @@ index d895a30..e8900ef 100644
continue;
}
ai_fam = peeraddr.sa.sa_family;
-@@ -744,13 +751,13 @@ void get(int argc, char *argv[])
+@@ -756,13 +763,13 @@ static void get(int argc, char *argv[])
if (fd < 0) {
fprintf(stderr, "tftp: ");
perror(cp);
@@ -337,7 +339,7 @@ index d895a30..e8900ef 100644
break;
}
cp = tail(src); /* new .. jdg */
-@@ -759,14 +766,16 @@ void get(int argc, char *argv[])
+@@ -771,14 +778,16 @@ static void get(int argc, char *argv[])
if (fd < 0) {
fprintf(stderr, "tftp: ");
perror(cp);
@@ -354,17 +356,17 @@ index d895a30..e8900ef 100644
+ return err;
}
- static void getusage(char *s)
-@@ -777,7 +786,7 @@ static void getusage(char *s)
-
+ static void getusage(const char *s)
+@@ -790,7 +799,7 @@ static void getusage(const char *s)
int rexmtval = TIMEOUT;
+ int maxtimeout = TIMEOUT_LIMIT * TIMEOUT;
--void setrexmt(int argc, char *argv[])
-+int setrexmt(int argc, char *argv[])
+-static void setrexmt(int argc, char *argv[])
++static int setrexmt(int argc, char *argv[])
{
int t;
-@@ -788,18 +797,19 @@ void setrexmt(int argc, char *argv[])
+@@ -801,7 +810,7 @@ static void setrexmt(int argc, char *argv[])
}
if (argc != 2) {
printf("usage: %s value\n", argv[0]);
@@ -372,21 +374,20 @@ index d895a30..e8900ef 100644
+ return EX_USAGE;
}
t = atoi(argv[1]);
- if (t < 0)
- printf("%s: bad value\n", argv[1]);
- else
+ if (t < 1)
+@@ -810,9 +819,10 @@ static void setrexmt(int argc, char *argv[])
rexmtval = t;
+ maxtimeout = rexmtval * TIMEOUT_LIMIT;
+ }
+ return 0;
}
- int maxtimeout = 5 * TIMEOUT;
-
--void settimeout(int argc, char *argv[])
-+int settimeout(int argc, char *argv[])
+-static void settimeout(int argc, char *argv[])
++static int settimeout(int argc, char *argv[])
{
int t;
-@@ -810,16 +820,17 @@ void settimeout(int argc, char *argv[])
+@@ -823,16 +833,17 @@ static void settimeout(int argc, char *argv[])
}
if (argc != 2) {
printf("usage: %s value\n", argv[0]);
@@ -394,19 +395,19 @@ index d895a30..e8900ef 100644
+ return EX_USAGE;
}
t = atoi(argv[1]);
- if (t < 0)
+ if (t < 1)
printf("%s: bad value\n", argv[1]);
else
maxtimeout = t;
+ return 0;
}
--void setblocksize(int argc, char *argv[])
-+int setblocksize(int argc, char *argv[])
+-static void setblocksize(int argc, char *argv[])
++static int setblocksize(int argc, char *argv[])
{
if (argc < 2) {
getmoreargs("blocksize ", "(size) ");
-@@ -828,15 +839,16 @@ void setblocksize(int argc, char *argv[])
+@@ -841,15 +852,16 @@ static void setblocksize(int argc, char *argv[])
}
if (argc != 2) {
printf("usage: %s size\n", argv[0]);
@@ -420,12 +421,12 @@ index d895a30..e8900ef 100644
+ return 0;
}
--void setwindowsize(int argc, char *argv[])
-+int setwindowsize(int argc, char *argv[])
+-static void setwindowsize(int argc, char *argv[])
++static int setwindowsize(int argc, char *argv[])
{
if (argc < 2) {
getmoreargs("windowsize ", "(size) ");
-@@ -845,23 +857,25 @@ void setwindowsize(int argc, char *argv[])
+@@ -858,23 +870,25 @@ static void setwindowsize(int argc, char *argv[])
}
if (argc != 2) {
printf("usage: %s size\n", argv[0]);
@@ -439,8 +440,8 @@ index d895a30..e8900ef 100644
+ return 0;
}
--void setliteral(int argc, char *argv[])
-+int setliteral(int argc, char *argv[])
+-static void setliteral(int argc, char *argv[])
++static int setliteral(int argc, char *argv[])
{
(void)argc;
(void)argv; /* Quiet unused warning */
@@ -449,38 +450,38 @@ index d895a30..e8900ef 100644
+ return 0;
}
--void status(int argc, char *argv[])
-+int status(int argc, char *argv[])
+-static void status(int argc, char *argv[])
++static int status(int argc, char *argv[])
{
(void)argc;
(void)argv; /* Quiet unused warning */
-@@ -876,6 +890,7 @@ void status(int argc, char *argv[])
+@@ -889,6 +903,7 @@ static void status(int argc, char *argv[])
rexmtval, maxtimeout);
printf("Blocksize: %u, windowsize: %u\n", blocksize,
windowsize ? windowsize : 1);
+ return 0;
}
- void intr(int sig)
-@@ -1018,7 +1033,7 @@ static int makeargv(char *str, char **argp)
+ static void intr(int sig)
+@@ -1031,7 +1046,7 @@ static int makeargv(char *str, char **argp)
return argc;
}
--void quit(int argc, char *argv[])
-+int quit(int argc, char *argv[])
+-static void quit(int argc, char *argv[])
++static int quit(int argc, char *argv[])
{
(void)argc;
(void)argv; /* Quiet unused warning */
-@@ -1028,7 +1043,7 @@ void quit(int argc, char *argv[])
+@@ -1041,7 +1056,7 @@ static void quit(int argc, char *argv[])
/*
* Help command.
*/
--void help(int argc, char *argv[])
-+int help(int argc, char *argv[])
+-static void help(int argc, char *argv[])
++static int help(int argc, char *argv[])
{
const struct cmd *c;
-@@ -1038,7 +1053,7 @@ void help(int argc, char *argv[])
+@@ -1051,7 +1066,7 @@ static void help(int argc, char *argv[])
printf("Commands may be abbreviated. Commands are:\n\n");
for (c = cmdtab; c->name; c++)
printf("%-*s\t%s\n", (int)HELPINDENT, c->name, c->help);
@@ -489,15 +490,15 @@ index d895a30..e8900ef 100644
}
while (--argc > 0) {
const char *errtype;
-@@ -1050,22 +1065,25 @@ void help(int argc, char *argv[])
+@@ -1063,18 +1078,20 @@ static void help(int argc, char *argv[])
else
printf("%s\n", c->help);
}
+ return 0;
}
--void settrace(int argc, char *argv[])
-+int settrace(int argc, char *argv[])
+-static void settrace(int argc, char *argv[])
++static int settrace(int argc, char *argv[])
{
(void)argc;
(void)argv; /* Quiet unused warning */
@@ -507,21 +508,39 @@ index d895a30..e8900ef 100644
+ return 0;
}
--void setverbose(int argc, char *argv[])
-+int setverbose(int argc, char *argv[])
+-static void set_verbosity(const char *to, bool startup)
++static int set_verbosity(const char *to, bool startup)
{
- (void)argc;
- (void)argv; /* Quiet unused warning */
+ const char *name;
+
+@@ -1090,7 +1107,7 @@ static void set_verbosity(const char *to, bool startup)
+ exit(EX_USAGE);
+ } else {
+ printf("Invalid verbosity level: %s\n", to);
+- return;
++ return EX_USAGE;
+ }
+ }
+ } else {
+@@ -1111,10 +1128,11 @@ static void set_verbosity(const char *to, bool startup)
- verbose = !verbose;
- printf("Verbose mode %s.\n", verbose ? "on" : "off");
+ if (!startup)
+ printf("Verbosity set to level %d (%s).\n", verbose, name);
+ return 0;
}
+
+-static void setverbose(int argc, char *argv[])
++static int setverbose(int argc, char *argv[])
+ {
+ (void)argc;
+- set_verbosity(argv[1], false);
++ return set_verbosity(argv[1], false);
+ }
diff --git a/tftp/tftp.c b/tftp/tftp.c
-index 332d652..0a48459 100644
+index b752787..4968ae3 100644
--- a/tftp/tftp.c
+++ b/tftp/tftp.c
-@@ -48,7 +48,7 @@ static void tpacket(const char *, struct tftphdr *, int);
+@@ -128,7 +128,7 @@ static const struct tftp_xfer_ops client_xfer_ops = {
/*
* Send the requested file.
*/
@@ -529,17 +548,17 @@ index 332d652..0a48459 100644
+int tftp_sendfile(int fd, const char *name, const char *mode,
unsigned int requested_window)
{
- struct tftphdr *dp, *ap;
-@@ -59,7 +59,7 @@ void tftp_sendfile(int fd, const char *name, const char *mode,
- FILE *file = NULL;
- char * volatile packets = NULL;
- int * volatile lengths = NULL;
+ struct tftphdr *ap;
+@@ -140,7 +140,7 @@ void tftp_sendfile(int fd, const char *name, const char *mode,
+ struct client_xfer_context context;
+ struct tftp_xfer xfer;
+ struct tftp_xfer_result result;
- int n, size;
+ int n, size, err = 0;
- size_t packetsize;
- volatile int packet_count, final;
- int convert = !strcmp(mode, "netascii");
-@@ -72,8 +72,10 @@ void tftp_sendfile(int fd, const char *name, const char *mode,
+ bool convert = !strcmp(mode, "netascii");
+ unsigned int window;
+ unsigned int negotiated_block, negotiated_window;
+@@ -151,8 +151,10 @@ void tftp_sendfile(int fd, const char *name, const char *mode,
startclock();
file = fdopen(fd, convert ? "rt" : "rb");
@@ -551,31 +570,31 @@ index 332d652..0a48459 100644
ap = (struct tftphdr *)ackbuf;
tftp_signal(SIGALRM, timer, 0);
-@@ -81,6 +83,7 @@ void tftp_sendfile(int fd, const char *name, const char *mode,
+@@ -160,6 +162,7 @@ void tftp_sendfile(int fd, const char *name, const char *mode,
sizeof(ackbuf));
if (size < 0) {
fprintf(stderr, "tftp: %s: %s\n", name, strerror(errno));
+ err = EX_OSERR;
- goto abort_packets;
+ goto abort;
}
-@@ -92,6 +95,7 @@ void tftp_sendfile(int fd, const char *name, const char *mode,
+@@ -171,6 +174,7 @@ void tftp_sendfile(int fd, const char *name, const char *mode,
tpacket("sent", ap, size);
if (sendto(f, ap, size, 0, &peeraddr.sa, SOCKLEN(&peeraddr)) != size) {
perror("tftp: sendto");
+ err = EX_OSERR;
- goto abort_packets;
+ goto abort;
}
- alarm(rexmtval);
-@@ -100,6 +104,7 @@ void tftp_sendfile(int fd, const char *name, const char *mode,
- alarm(0);
+ r_timeout = timeout;
+@@ -178,6 +182,7 @@ void tftp_sendfile(int fd, const char *name, const char *mode,
+ n = client_recv_time(response, sizeof(response), &from, &r_timeout);
if (n < 0) {
perror("tftp: recvfrom");
+ err = EX_OSERR;
- goto abort_packets;
+ goto abort;
}
- sa_set_port(&peeraddr, SOCKPORT(&from));
-@@ -111,12 +116,14 @@ void tftp_sendfile(int fd, const char *name, const char *mode,
+ if (n < 2)
+@@ -188,12 +193,14 @@ void tftp_sendfile(int fd, const char *name, const char *mode,
ap_block = ntohs(rp->th_block);
if (ap_opcode == ERROR) {
printf("Error code %d: %s\n", ap_block, rp->th_msg);
@@ -590,42 +609,40 @@ index 332d652..0a48459 100644
goto abort;
}
segsize = (int)negotiated_block;
-@@ -143,6 +150,7 @@ void tftp_sendfile(int fd, const char *name, const char *mode,
- size = readit(file, &dp, convert);
- if (size < 0) {
- nak(errno + 100, NULL);
-+ err = EX_OSERR;
- goto abort_packets;
- }
- dp->th_opcode = htons((u_short)DATA);
-@@ -168,6 +176,7 @@ void tftp_sendfile(int fd, const char *name, const char *mode,
- if (sendto(f, dp, lengths[n], 0, &peeraddr.sa,
- SOCKLEN(&peeraddr)) != lengths[n]) {
- perror("tftp: sendto");
-+ err = EX_OSERR;
- goto abort_packets;
- }
- }
-@@ -178,6 +187,7 @@ void tftp_sendfile(int fd, const char *name, const char *mode,
- alarm(0);
- if (n < 0) {
- perror("tftp: recvfrom");
-+ err = EX_OSERR;
- goto abort_packets;
- }
- sa_set_port(&peeraddr, SOCKPORT(&from));
-@@ -189,6 +199,7 @@ void tftp_sendfile(int fd, const char *name, const char *mode,
- ap_block = ntohs(ap->th_block);
- if (ap_opcode == ERROR) {
- printf("Error code %d: %s\n", ap_block, ap->th_msg);
-+ err = EX_PROTOCOL;
- goto abort_packets;
- }
- expected_ack = ntohs(((struct tftphdr *)(packets +
-@@ -216,12 +227,14 @@ void tftp_sendfile(int fd, const char *name, const char *mode,
+@@ -213,6 +220,7 @@ void tftp_sendfile(int fd, const char *name, const char *mode,
+ io = tftp_io_reader_start(file, convert, window, window, segsize, false);
+ if (!io) {
+ nak(errno + 100, NULL);
++ err = EX_OSERR;
+ goto abort;
+ }
+
+@@ -234,17 +242,21 @@ void tftp_sendfile(int fd, const char *name, const char *mode,
+ switch (result.status) {
+ case TFTP_XFER_READ_ERROR:
+ nak(result.error + 100, NULL);
++ err = EX_OSERR;
+ break;
+ case TFTP_XFER_SEND_ERROR:
+ errno = result.error;
+ perror("tftp: sendto");
++ err = EX_OSERR;
+ break;
+ case TFTP_XFER_RECV_ERROR:
+ errno = result.error;
+ perror("tftp: recvfrom");
++ err = EX_OSERR;
+ break;
+ case TFTP_XFER_PEER_ERROR:
+ printf("Error code %d: %s\n", ntohs(ap->th_code), ap->th_msg);
++ err = EX_PROTOCOL;
+ break;
+ default:
+ break;
+@@ -256,13 +268,15 @@ void tftp_sendfile(int fd, const char *name, const char *mode,
stopclock();
if (amount > 0)
- printstats("Sent", (unsigned long)amount);
+ printstats("Sent", amount);
+
+ return err;
}
@@ -634,19 +651,22 @@ index 332d652..0a48459 100644
* Receive a file.
*/
-void tftp_recvfile(int fd, const char *name, const char *mode,
+- unsigned int requested_window)
+int tftp_recvfile(int fd, const char *name, const char *mode,
- unsigned int requested_window)
++ unsigned int requested_window)
{
- struct tftphdr *ap, *dp;
-@@ -229,6 +242,7 @@ void tftp_recvfile(int fd, const char *name, const char *mode,
- socklen_t fromlen;
- FILE *file = NULL;
- volatile int n, size, packets_in_window = 0, first_data = 0, final;
-+ int err = 0;
- int convert = !strcmp(mode, "netascii");
- volatile unsigned int window;
+ struct tftphdr *ap;
+ union sock_addr from;
+@@ -275,7 +289,7 @@ void tftp_recvfile(int fd, const char *name, const char *mode,
+ const struct tftphdr * volatile initial_reply = NULL;
+ volatile int initial_reply_len = 0;
+ volatile int initial_packet_len = -1;
+- int n, size;
++ int n, size, err = 0;
+ bool convert = !strcmp(mode, "netascii");
+ unsigned int window;
unsigned int negotiated_block, negotiated_window;
-@@ -239,14 +253,17 @@ void tftp_recvfile(int fd, const char *name, const char *mode,
+@@ -286,14 +300,17 @@ void tftp_recvfile(int fd, const char *name, const char *mode,
startclock();
file = fdopen(fd, convert ? "wt" : "wb");
@@ -655,7 +675,7 @@ index 332d652..0a48459 100644
+ err = EX_OSERR;
goto abort;
+ }
- dp = w_init();
+ initial_packet = xmalloc(TFTP_XFER_MAX_PACKET_SIZE);
ap = (struct tftphdr *)ackbuf;
size = makerequest(RRQ, name, ap, mode, blocksize, requested_window,
sizeof(ackbuf));
@@ -665,83 +685,80 @@ index 332d652..0a48459 100644
goto abort;
}
tftp_signal(SIGALRM, timer, 0);
-@@ -259,6 +276,7 @@ void tftp_recvfile(int fd, const char *name, const char *mode,
+@@ -306,6 +323,7 @@ void tftp_recvfile(int fd, const char *name, const char *mode,
tpacket("sent", ap, size);
if (sendto(f, ap, size, 0, &peeraddr.sa, SOCKLEN(&peeraddr)) != size) {
perror("tftp: sendto");
+ err = EX_OSERR;
goto abort;
}
- alarm(rexmtval);
-@@ -277,12 +295,14 @@ void tftp_recvfile(int fd, const char *name, const char *mode,
- tpacket("received", dp, n);
+ r_timeout = timeout;
+@@ -314,6 +332,7 @@ void tftp_recvfile(int fd, const char *name, const char *mode,
+ &from, &r_timeout);
+ if (n < 0) {
+ perror("tftp: recvfrom");
++ err = EX_OSERR;
+ goto abort;
+ }
+ if (n < 2)
+@@ -324,12 +343,14 @@ void tftp_recvfile(int fd, const char *name, const char *mode,
if (opcode == ERROR) {
- printf("Error code %d: %s\n", ntohs(dp->th_code), dp->th_msg);
+ printf("Error code %d: %s\n",
+ ntohs(initial_packet->th_code), initial_packet->th_msg);
+ err = EX_PROTOCOL;
goto abort;
}
if (requested_options && opcode == OACK) {
- if (!parse_oack(dp, n, blocksize, requested_window,
+ if (!parse_oack(initial_packet, n, blocksize, requested_window,
&negotiated_block, &negotiated_window)) {
nak(EOPTNEG, "Invalid option response");
+ err = EX_PROTOCOL;
goto abort;
}
segsize = (int)negotiated_block;
-@@ -306,6 +326,7 @@ void tftp_recvfile(int fd, const char *name, const char *mode,
- tpacket("sent", ap, size);
- if (sendto(f, ap, size, 0, &peeraddr.sa, SOCKLEN(&peeraddr)) != size) {
- perror("tftp: sendto");
-+ err = EX_OSERR;
- goto abort;
- }
- write_behind(file, convert);
-@@ -329,6 +350,7 @@ void tftp_recvfile(int fd, const char *name, const char *mode,
- if (sendto(f, ap, 4, 0, &peeraddr.sa,
- SOCKLEN(&peeraddr)) != 4) {
- perror("tftp: sendto");
-+ err = EX_OSERR;
- goto abort;
- }
- write_behind(file, convert);
-@@ -340,6 +362,7 @@ void tftp_recvfile(int fd, const char *name, const char *mode,
- alarm(0);
- if (n < 0) {
- perror("tftp: recvfrom");
-+ err = EX_OSERR;
- goto abort;
- }
- if (trace)
-@@ -352,6 +375,7 @@ void tftp_recvfile(int fd, const char *name, const char *mode,
- packet_block = ntohs(dp->th_block);
- if (opcode == ERROR) {
- printf("Error code %d: %s\n", packet_block, dp->th_msg);
-+ err = EX_PROTOCOL;
- goto abort;
- }
- if (opcode != DATA || n < 4)
-@@ -369,11 +393,13 @@ void tftp_recvfile(int fd, const char *name, const char *mode,
- }
- if (n - 4 > segsize) {
- nak(EBADOP, "Data packet too large");
-+ err = EX_PROTOCOL;
- goto abort;
- }
- size = writeit(file, &dp, n - 4, convert);
- if (size < 0) {
- nak(errno + 100, NULL);
-+ err = EX_OSERR;
- goto abort;
- }
- amount += size;
-@@ -390,6 +416,7 @@ void tftp_recvfile(int fd, const char *name, const char *mode,
- if (sendto(f, ap, 4, 0, &peeraddr.sa,
- SOCKLEN(&peeraddr)) != 4) {
- perror("tftp: sendto");
-+ err = EX_OSERR;
- goto abort;
- }
- write_behind(file, convert);
+@@ -355,6 +376,7 @@ void tftp_recvfile(int fd, const char *name, const char *mode,
+ io = tftp_io_writer_start(file, convert, window, segsize, false);
+ if (!io) {
+ nak(errno + 100, NULL);
++ err = EX_OSERR;
+ goto abort;
+ }
+
+@@ -381,21 +403,26 @@ void tftp_recvfile(int fd, const char *name, const char *mode,
+ switch (result.status) {
+ case TFTP_XFER_BAD_DATA:
+ nak(EBADOP, "Data packet too large");
++ err = EX_PROTOCOL;
+ break;
+ case TFTP_XFER_WRITE_ERROR:
+ nak(result.error + 100, NULL);
++ err = EX_OSERR;
+ break;
+ case TFTP_XFER_SEND_ERROR:
+ errno = result.error;
+ perror("tftp: sendto");
++ err = EX_OSERR;
+ break;
+ case TFTP_XFER_RECV_ERROR:
+ errno = result.error;
+ perror("tftp: recvfrom");
++ err = EX_OSERR;
+ break;
+ case TFTP_XFER_PEER_ERROR:
+ printf("Error code %d: %s\n", ntohs(result.packet->th_code),
+ result.packet->th_msg);
++ err = EX_PROTOCOL;
+ break;
+ default:
+ break;
+@@ -412,6 +439,7 @@ void tftp_recvfile(int fd, const char *name, const char *mode,
+ stopclock();
+ if (amount > 0)
+ printstats("Received", amount);
++ return err;
+ }
+
+ static int
--
2.55.0
diff --git a/tftp-hpa-6.0-stats.patch b/tftp-hpa-6.0-stats.patch
deleted file mode 100644
index 386a93d..0000000
--- a/tftp-hpa-6.0-stats.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 7b4b6f75214c1c64d86f6c333db5dede33ef5e43 Mon Sep 17 00:00:00 2001
-From: Lukáš Zaoral via Syslinux <syslinux@syslinux.org>
-Date: Wed, 15 Apr 2026 10:15:23 +0200
-Subject: tftp: correctly convert μs to s to fix transfer statistics
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Before this patch, the microseconds difference was computed incorrectly
-leading to wrong transfer statistics. The value should be divided by
-a million and not by 100,000.
-
-$ ./tftp/tftp localhost -v -c get 10MB
-Connected to localhost (::1), port 69
-getting from localhost:10MB to 10MB [netascii]
-Received 10485760 bytes in -7.5 seconds [-11164298 bit/s]
-
-Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
-Signed-off-by: Lukáš Zaoral <lzaoral@redhat.com>
-Signed-off-by: H. Peter Anvin <hpa@zytor.com>
----
- tftp/tftp.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/tftp/tftp.c b/tftp/tftp.c
-index abc25b9..d9c9394 100644
---- a/tftp/tftp.c
-+++ b/tftp/tftp.c
-@@ -638,8 +638,8 @@ static void printstats(const char *direction, unsigned long amount)
- {
- double delta;
-
-- delta = (tstop.tv_sec + (tstop.tv_usec / 100000.0)) -
-- (tstart.tv_sec + (tstart.tv_usec / 100000.0));
-+ delta = (tstop.tv_sec + (tstop.tv_usec / 1000000.0)) -
-+ (tstart.tv_sec + (tstart.tv_usec / 1000000.0));
- if (verbose) {
- printf("%s %lu bytes in %.1f seconds", direction, amount, delta);
- printf(" [%.0f bit/s]", (amount * 8.) / delta);
---
-cgit 1.3.1-korg
diff --git a/tftp.service b/tftp.service
index c26ad3b..0c88dd9 100644
--- a/tftp.service
+++ b/tftp.service
@@ -4,8 +4,7 @@ Requires=tftp.socket
Documentation=man:in.tftpd
[Service]
-ExecStart=/usr/sbin/in.tftpd -s /var/lib/tftpboot
-StandardInput=socket
+ExecStart=/usr/sbin/in.tftpd --systemd -s /var/lib/tftpboot
[Install]
Also=tftp.socket
diff --git a/tftp.socket b/tftp.socket
index 8764c1d..3bb6622 100644
--- a/tftp.socket
+++ b/tftp.socket
@@ -1,5 +1,6 @@
[Unit]
Description=Tftp Server Activation Socket
+PartOf=tftp.service
[Socket]
ListenDatagram=69
diff --git a/tftp.spec b/tftp.spec
index 61aeb5a..6692742 100644
--- a/tftp.spec
+++ b/tftp.spec
@@ -2,7 +2,7 @@
Summary: The client for the Trivial File Transfer Protocol (TFTP)
Name: tftp
-Version: 6.0
+Version: 6.1
Release: 1%{?dist}
License: BSD-4-Clause-UC
URL: http://www.kernel.org/pub/software/network/tftp/
@@ -15,9 +15,6 @@ Source3: tftp.socket
Source4: tftp.service
Source5: tftp-server-tmpfiles.conf
-# Upstream patches
-Patch: tftp-hpa-6.0-stats.patch
-
# To-be upstreamed patches
Patch: tftp-enhanced-logging.patch
Patch: tftp-hpa-5.2-osh.patch
@@ -96,6 +93,10 @@ install -D -p -m 644 %SOURCE5 %{buildroot}%{_tmpfilesdir}/%{name}.conf
%{_unitdir}/tftp.socket
%changelog
+* Mon Sep 07 2026 Lukáš Zaoral <lzaoral@redhat.com> - 6.1-1
+- rebase to the latest upstream release (rhbz#2529277)
+- use the native support for systemd socket activation in tftpd
+
* Mon Aug 31 2026 Lukáš Zaoral <lzaoral@redhat.com> - 6.0-1
- rebase to the latest upstream release (rhbz#2525859)
next reply other threads:[~2026-09-08 10:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-08 10:49 [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-09-03 9:12 [rpms/tftp] rawhide: rebase to the latest upstream release
2026-07-09 20:16
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=178886456012.1.7405682424623179530.rpms-tftp-b2788cd12c6c@fedoraproject.org \
--to=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox