diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f326c84 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/libnetfilter_queue-1.0.2.tar.bz2 diff --git a/.libnetfilter_queue.metadata b/.libnetfilter_queue.metadata new file mode 100644 index 0000000..34a7576 --- /dev/null +++ b/.libnetfilter_queue.metadata @@ -0,0 +1 @@ +8cc0b8ed33162281bc9fa8bcfa8c9dcb08848ff9 SOURCES/libnetfilter_queue-1.0.2.tar.bz2 diff --git a/SOURCES/libnetfilter_queue-1.0.2-rh1348210.patch b/SOURCES/libnetfilter_queue-1.0.2-rh1348210.patch new file mode 100644 index 0000000..adf8bf8 --- /dev/null +++ b/SOURCES/libnetfilter_queue-1.0.2-rh1348210.patch @@ -0,0 +1,49 @@ +From 4ca06bc967d94b7b7b5a6efc76e870f0efc77e24 Mon Sep 17 00:00:00 2001 +From: Florian Westphal +Date: Thu, 16 Jun 2016 15:11:32 +0200 +Subject: src: make nfq_open_nfnl thread-safe + +nfq_open_nfnl uses an intermediate static object, so when it is invoked +by distinct threads at the same time there is a small chance that some +threads end up with another threads nfq_handle pointer stored in ->data. + +The result is that the affected queue will be stuck because the thread +that was supposed to service it is handling another/wrong queue instead. + +Tested-by: Michal Tesar +Signed-off-by: Florian Westphal +Acked-by: Pablo Neira Ayuso +--- + src/libnetfilter_queue.c | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +diff --git a/src/libnetfilter_queue.c b/src/libnetfilter_queue.c +index 84184ee..5fbde5b 100644 +--- a/src/libnetfilter_queue.c ++++ b/src/libnetfilter_queue.c +@@ -216,11 +216,6 @@ static int __nfq_rcv_pkt(struct nlmsghdr *nlh, struct nfattr *nfa[], + return qh->cb(qh, nfmsg, &nfqa, qh->data); + } + +-static struct nfnl_callback pkt_cb = { +- .call = &__nfq_rcv_pkt, +- .attr_count = NFQA_MAX, +-}; +- + /* public interface */ + + struct nfnl_handle *nfq_nfnlh(struct nfq_handle *h) +@@ -389,6 +384,10 @@ EXPORT_SYMBOL(nfq_open); + */ + struct nfq_handle *nfq_open_nfnl(struct nfnl_handle *nfnlh) + { ++ struct nfnl_callback pkt_cb = { ++ .call = __nfq_rcv_pkt, ++ .attr_count = NFQA_MAX, ++ }; + struct nfq_handle *h; + int err; + +-- +cgit v0.12 + diff --git a/SPECS/libnetfilter_queue.spec b/SPECS/libnetfilter_queue.spec new file mode 100644 index 0000000..d879efb --- /dev/null +++ b/SPECS/libnetfilter_queue.spec @@ -0,0 +1,127 @@ +%define libnfnetlink 1.0.1 + +Name: libnetfilter_queue +Version: 1.0.2 +Release: 2%{?dist} +Summary: Netfilter queue userspace library +Group: System Environment/Libraries +# 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 +Patch0: libnetfilter_queue-1.0.2-rh1348210.patch + +BuildRequires: pkgconfig, kernel-headers +BuildRequires: libnfnetlink-devel >= %{libnfnetlink}, libmnl-devel >= 1.0.3 + +%description +libnetfilter_queue is a userspace library providing an API to packets that have +been queued by the kernel packet filter. It is is part of a system that +deprecates the old ip_queue / libipq mechanism. + +libnetfilter_queue has been previously known as libnfnetlink_queue. + +%package devel +Summary: Netfilter queue userspace library +Group: Development/Libraries +Requires: %{name} = %{version}-%{release}, pkgconfig +Requires: libnfnetlink-devel >= %{libnfnetlink}, kernel-headers + +%description devel +libnetfilter_queue is a userspace library providing an API to packets that have +been queued by the kernel packet filter. It is is part of a system that +deprecates the old ip_queue / libipq mechanism. + +libnetfilter_queue has been previously known as libnfnetlink_queue. + +%prep +%setup -q +%patch0 -p1 + +%build +%configure --disable-silent-rules --disable-static --disable-rpath +make %{?_smp_mflags} + +%install +%make_install +find %{buildroot} -type f -name "*.la" -delete +rm %{buildroot}/%{_includedir}/internal.h + +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig + +%files +%defattr(-,root,root,-) +%doc COPYING +%{_libdir}/*.so.* + +%files devel +%defattr(-,root,root,-) +%{_libdir}/*.so +%dir %{_includedir}/%{name} +%{_includedir}/%{name}/*.h +%{_libdir}/pkgconfig/%{name}.pc + +%changelog +* Fri Jul 08 2016 Pavel Šimerda - 1.0.2-2 +- Resolves: #1348210 - libnetfilter_queue might not process packets from a given + queue + +* Thu Aug 28 2014 Pavel Šimerda - 1.0.2-1 +- Resolves: #1058375 - provide libnetfilter_queue package for RHEL 7.1 + +* Thu Jul 19 2012 Fedora Release Engineering - 1.0.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Sat Mar 17 2012 Paul P. Komkoff Jr - 1.0.1-1 +- upstream release + +* Fri Jan 13 2012 Fedora Release Engineering - 1.0.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Tue Feb 08 2011 Fedora Release Engineering - 1.0.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Wed Aug 4 2010 Paul P. Komkoff Jr - 1.0.0-1 +- new upstream version + +* Fri Jul 24 2009 Fedora Release Engineering - 0.0.17-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Sat Mar 7 2009 Paul P. Komkoff Jr - 0.0.17-1 +- upstream update + +* Wed Feb 25 2009 Fedora Release Engineering - 0.0.16-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Sun Oct 26 2008 Paul P. Komkoff Jr - 0.0.16-3 +- fix patch/patch0 +- depend on specific libnfnetlink version + +* Thu Aug 7 2008 Tom "spot" Callaway - 0.0.16-2 +- fix license tag + +* Wed Jul 16 2008 Paul P. Komkoff Jr - 0.0.16-1 +- new upstream version + +* Fri Feb 22 2008 Paul P Komkoff Jr - 0.0.15-4 +- use system header instead of bundled one + +* Fri Feb 22 2008 Paul P Komkoff Jr - 0.0.15-3 +- fix compilation with newer glibc/headers/whatever + +* Tue Feb 19 2008 Fedora Release Engineering - 0.0.15-2 +- Autorebuild for GCC 4.3 + +* Tue Sep 18 2007 Paul P Komkoff Jr - 0.0.15-1 +- new upstream version + +* Mon Mar 26 2007 Paul P Komkoff Jr - 0.0.13-3 +- own some directories + +* Mon Mar 19 2007 Paul P Komkoff Jr - 0.0.13-2 +- fix source url +- add pkgconfig to -devel Requires + +* Sat Mar 17 2007 Paul P Komkoff Jr - 0.0.13-1 +- Preparing for submission to fedora extras