From 4ef2dc04889558e7d0aede0cbe1de1ab0f1ea09d Mon Sep 17 00:00:00 2001 From: eabdullin Date: Thu, 28 Mar 2024 11:55:25 +0000 Subject: [PATCH] import CS tftp-5.2-38.el9 --- 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 67273d1..d9b3ba2 100644 --- a/SPECS/tftp.spec +++ b/SPECS/tftp.spec @@ -3,7 +3,7 @@ Summary: The client for the Trivial File Transfer Protocol (TFTP) Name: tftp Version: 5.2 -Release: 37%{?dist} +Release: 38%{?dist} License: BSD URL: http://www.kernel.org/pub/software/network/tftp/ Source0: http://www.kernel.org/pub/software/network/tftp/tftp-hpa/tftp-hpa-%{version}.tar.bz2 @@ -107,6 +107,9 @@ install -p -m 644 %SOURCE2 ${RPM_BUILD_ROOT}%{_unitdir} %{_unitdir}/* %changelog +* Thu Jan 04 2024 Lukáš Zaoral - 5.2-38 +- fix regression with too chatty syslog calls when IPv6 is disabled (RHEL-19588) + * Wed Apr 06 2022 Lukáš Zaoral - 5.2-37 - Review and fix issues reported by static analysers (rhbz#2069613) - Use systemd-rpm-macros and modernise the specfile a bit