diff --git a/0001-extra-use-inet_ntop-instead-of-inet_ntoa.patch b/0001-extra-use-inet_ntop-instead-of-inet_ntoa.patch new file mode 100644 index 0000000..d4dabe2 --- /dev/null +++ b/0001-extra-use-inet_ntop-instead-of-inet_ntoa.patch @@ -0,0 +1,37 @@ +From 3065fb3642c8e554432059629808a62560e2184f Mon Sep 17 00:00:00 2001 +From: Ting-Wei Lan +Date: Fri, 20 Jun 2014 18:26:59 +0800 +Subject: [PATCH] extra: use inet_ntop instead of inet_ntoa + +The result of inet_ntoa() will be overwritten by the next call to +inet_ntoa(), so using it twice in the same snprintf() call causes +wrong result. + +Signed-off-by: Pablo Neira Ayuso +Signed-off-by: Phil Sutter +--- + src/extra/ipv4.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/src/extra/ipv4.c b/src/extra/ipv4.c +index 0fe716ba4697c..a93d113fb23cf 100644 +--- a/src/extra/ipv4.c ++++ b/src/extra/ipv4.c +@@ -134,9 +134,13 @@ int nfq_ip_snprintf(char *buf, size_t size, const struct iphdr *iph) + struct in_addr src = { iph->saddr }; + struct in_addr dst = { iph->daddr }; + ++ char src_str[INET_ADDRSTRLEN]; ++ char dst_str[INET_ADDRSTRLEN]; ++ + ret = snprintf(buf, size, "SRC=%s DST=%s LEN=%u TOS=0x%X " + "PREC=0x%X TTL=%u ID=%u PROTO=%u ", +- inet_ntoa(src), inet_ntoa(dst), ++ inet_ntop(AF_INET, &src, src_str, INET_ADDRSTRLEN), ++ inet_ntop(AF_INET, &dst, dst_str, INET_ADDRSTRLEN), + ntohs(iph->tot_len), IPTOS_TOS(iph->tos), + IPTOS_PREC(iph->tos), iph->ttl, ntohs(iph->id), + iph->protocol); +-- +2.31.0 + diff --git a/libnetfilter_queue.spec b/libnetfilter_queue.spec index 7220d8f..49a6fb5 100644 --- a/libnetfilter_queue.spec +++ b/libnetfilter_queue.spec @@ -2,13 +2,15 @@ Name: libnetfilter_queue Version: 1.0.2 -Release: 18%{?dist} +Release: 19%{?dist} Summary: Netfilter queue userspace library # Most files say GPLv2+, one says v2 only. License: GPLv2 URL: http://netfilter.org Source0: http://netfilter.org/projects/%{name}/files/%{name}-%{version}.tar.bz2 +Patch1: 0001-extra-use-inet_ntop-instead-of-inet_ntoa.patch + BuildRequires: libnfnetlink-devel >= %{libnfnetlink}, pkgconfig, kernel-headers BuildRequires: autoconf, automake, libtool, libmnl-devel >= 1.0.3 BuildRequires: make @@ -33,7 +35,7 @@ deprecates the old ip_queue / libipq mechanism. libnetfilter_queue has been previously known as libnfnetlink_queue. %prep -%setup -q +%autosetup -p1 %build %configure --disable-static @@ -58,6 +60,9 @@ rm %{buildroot}/%{_includedir}/internal.h %{_libdir}/pkgconfig/%{name}.pc %changelog +* Mon Apr 19 2021 Phil Sutter - 1.0.2-19 +- extra: use inet_ntop instead of inet_ntoa + * Fri Apr 16 2021 Mohan Boddu - 1.0.2-18 - Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937