From 1f55ca7df6c4ac822daa3dc5d8cb659a78158207 Mon Sep 17 00:00:00 2001 From: eabdullin Date: Wed, 27 Mar 2024 20:35:07 +0000 Subject: [PATCH] import CS tftp-5.2-27.el8 --- SOURCES/tftp-hpa-5.2-covscan.patch | 52 ------------------------------ SPECS/tftp.spec | 5 ++- 2 files changed, 4 insertions(+), 53 deletions(-) diff --git a/SOURCES/tftp-hpa-5.2-covscan.patch b/SOURCES/tftp-hpa-5.2-covscan.patch index 5473231..d0c5719 100644 --- a/SOURCES/tftp-hpa-5.2-covscan.patch +++ b/SOURCES/tftp-hpa-5.2-covscan.patch @@ -128,58 +128,6 @@ index 1b8a881..b2f9059 100644 -- 2.35.1 -# Fix Calling "setsockopt" without checking return value. This library -# function may fail and return an error code. -diff --git a/tftpd/recvfrom.c b/tftpd/recvfrom.c -index d7ef500..e0074d8 100644 ---- a/tftpd/recvfrom.c -+++ b/tftpd/recvfrom.c -@@ -26,6 +26,7 @@ - - #if defined(HAVE_RECVMSG) && defined(HAVE_MSGHDR_MSG_CONTROL) - -+#include - #include - - #ifdef IP_PKTINFO -@@ -151,16 +151,19 @@ myrecvfrom(int s, void *buf, int len, unsigned int flags, - /* Try to enable getting the return address */ - #ifdef IP_RECVDSTADDR - if (from->sa_family == AF_INET || !from->sa_family) -- setsockopt(s, IPPROTO_IP, IP_RECVDSTADDR, &on, sizeof(on)); -+ if (setsockopt(s, IPPROTO_IP, IP_RECVDSTADDR, &on, sizeof(on)) == -1) -+ syslog(LOG_ERR, "cannot setsockopt IP_RECVDSTADDR %m"); - #endif - #ifdef IP_PKTINFO - if (from->sa_family == AF_INET || !from->sa_family) -- setsockopt(s, IPPROTO_IP, IP_PKTINFO, &on, sizeof(on)); -+ if (setsockopt(s, IPPROTO_IP, IP_PKTINFO, &on, sizeof(on)) == -1) -+ syslog(LOG_ERR, "cannot setsockopt IP_PKTINFO %m"); - #endif - #ifdef HAVE_IPV6 - #ifdef IPV6_RECVPKTINFO - if (from->sa_family == AF_INET6 || !from->sa_family) -- setsockopt(s, IPPROTO_IPV6, IPV6_RECVPKTINFO, &on, sizeof(on)); -+ if (setsockopt(s, IPPROTO_IPV6, IPV6_RECVPKTINFO, &on, sizeof(on)) == -1) -+ syslog(LOG_ERR, "cannot setsockopt IPV6_RECVPKTINFO %m"); - #endif - #endif - bzero(&msg, sizeof msg); /* Clear possible system-dependent fields */ -diff --git a/tftpd/tftpd.c b/tftpd/tftpd.c -index 364e7d2..36d6dec 100644 ---- a/tftpd/tftpd.c -+++ b/tftpd/tftpd.c -@@ -224,7 +224,9 @@ static void pmtu_discovery_off(int fd) - #if defined(IP_MTU_DISCOVER) && defined(IP_PMTUDISC_DONT) - int pmtu = IP_PMTUDISC_DONT; - -- setsockopt(fd, IPPROTO_IP, IP_MTU_DISCOVER, &pmtu, sizeof(pmtu)); -+ if (setsockopt(fd, IPPROTO_IP, IP_MTU_DISCOVER, &pmtu, sizeof(pmtu)) == -1) -+ syslog(LOG_ERR, "cannot setsockopt IP_MTU_DISCOVER to " -+ "IP_PMTUDISC_DONT %m"); - #endif - } - # Fixes negative_returns: "fd" is passed to a parameter of pmtu_discovery_off # that cannot be negative From 0b44159b3a2f51d350f309d3f6d14a17e74e8231 Mon Sep 17 00:00:00 2001 diff --git a/SPECS/tftp.spec b/SPECS/tftp.spec index e11c2a9..f966abb 100644 --- a/SPECS/tftp.spec +++ b/SPECS/tftp.spec @@ -4,7 +4,7 @@ Summary: The client for the Trivial File Transfer Protocol (TFTP) Name: tftp Version: 5.2 -Release: 26%{?dist} +Release: 27%{?dist} License: BSD Group: Applications/Internet URL: http://www.kernel.org/pub/software/network/tftp/ @@ -108,6 +108,9 @@ rm -rf ${RPM_BUILD_ROOT} %{_unitdir}/* %changelog +* Thu Jan 04 2024 Lukáš Zaoral - 5.2-37 +- fix regression with too chatty syslog calls when IPv6 is disabled (RHEL-20691) + * Tue Apr 26 2022 Lukáš Zaoral - 5.2-26 - Review and fix issues reported by static analysers (rhbz#2078858)