From da404bb615575555e64e519928fca7fce6dcf072d65baf130dbce1b6b5dff3ec Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 30 Jun 2012 00:05:23 +0000 Subject: [PATCH 1/6] Enable builds for RHEL/SLES OBS-URL: https://build.opensuse.org/package/show/security:netfilter/libnetfilter_queue?expand=0&rev=22 --- libnetfilter_queue.spec | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/libnetfilter_queue.spec b/libnetfilter_queue.spec index 993878d..1f80bf5 100644 --- a/libnetfilter_queue.spec +++ b/libnetfilter_queue.spec @@ -16,11 +16,11 @@ # - Name: libnetfilter_queue %define libsoname %{name}1 Version: 1.0.1 -Release: 1 +Release: 0 +Summary: Userspace library for packets that have been queued by the kernel packet filter License: GPL-2.0 Group: Productivity/Networking/Security Url: http://netfilter.org/projects/libnetfilter_queue/ @@ -30,9 +30,15 @@ Source: ftp://ftp.netfilter.org/pub/libnetfilter_queue/%name-%version.ta Source2: ftp://ftp.netfilter.org/pub/libnetfilter_queue/%name-%version.tar.bz2.sig Source3: baselibs.conf BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildRequires: autoconf automake >= 1.6 libtool -BuildRequires: pkgconfig >= 0.23 pkgconfig(libnfnetlink) >= 0.0.41 -Summary: Userspace library for packets that have been queued by the kernel packet filter +BuildRequires: autoconf +BuildRequires: automake >= 1.6 +BuildRequires: libtool +BuildRequires: pkgconfig >= 0.21 +%if 0%{?suse_version} >= 1140 +BuildRequires: pkgconfig(libnfnetlink) >= 0.0.41 +%else +BuildRequires: libnfnetlink-devel >= 0.0.41 +%endif %description libnetfilter_queue is a userspace library providing an API to packets @@ -42,8 +48,8 @@ system that deprecates the old ip_queue / libipq mechanism. libnetfilter_queue has been previously known as libnfnetlink_queue. %package -n %libsoname -Group: System/Libraries Summary: Userspace library for packets that have been queued by the kernel packet filter +Group: System/Libraries %description -n %libsoname libnetfilter_queue is a userspace library providing an API to packets @@ -53,9 +59,10 @@ system that deprecates the old ip_queue / libipq mechanism. libnetfilter_queue has been previously known as libnfnetlink_queue. %package devel -Group: Development/Libraries/C and C++ -Requires: %libsoname = %version, libnfnetlink-devel +Requires: %libsoname = %version +Requires: libnfnetlink-devel Summary: Userspace library for packets that have been queued by the kernel packet filter +Group: Development/Libraries/C and C++ %description devel libnetfilter_queue is a userspace library providing an API to packets From 907794ead3cefdf394e97654c0c69fcc747309bc148f6438f5d14749a324bffb Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 30 Jun 2012 01:08:09 +0000 Subject: [PATCH 2/6] Enable builds for RHEL/SLES OBS-URL: https://build.opensuse.org/package/show/security:netfilter/libnetfilter_queue?expand=0&rev=23 --- libnetfilter_queue.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libnetfilter_queue.spec b/libnetfilter_queue.spec index 1f80bf5..e0ef69b 100644 --- a/libnetfilter_queue.spec +++ b/libnetfilter_queue.spec @@ -82,7 +82,7 @@ fi; make %{?_smp_mflags} %install -%makeinstall +make install DESTDIR="%buildroot"; rm -f "%buildroot/%_libdir"/*.la; %post -n %libsoname -p /sbin/ldconfig @@ -95,7 +95,7 @@ rm -f "%buildroot/%_libdir"/*.la; %files devel %defattr(-,root,root) -%_includedir/libnetfilter_queue* +%_includedir/%name-%version %_libdir/libnetfilter_queue.so %_libdir/pkgconfig/libnetfilter_queue.pc From b49e9bcacd45a2a09487f87b0dba9e2edcd9ba91f3daaa37c26b0e994de1f07c Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 30 Jun 2012 01:40:14 +0000 Subject: [PATCH 3/6] Packaging fixes for RHEL/SLES OBS-URL: https://build.opensuse.org/package/show/security:netfilter/libnetfilter_queue?expand=0&rev=24 --- libnetfilter_queue.spec | 17 ++++++++++++++++- nfq-stray-var.diff | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 nfq-stray-var.diff diff --git a/libnetfilter_queue.spec b/libnetfilter_queue.spec index e0ef69b..108459a 100644 --- a/libnetfilter_queue.spec +++ b/libnetfilter_queue.spec @@ -29,9 +29,16 @@ Url: http://netfilter.org/projects/libnetfilter_queue/ Source: ftp://ftp.netfilter.org/pub/libnetfilter_queue/%name-%version.tar.bz2 Source2: ftp://ftp.netfilter.org/pub/libnetfilter_queue/%name-%version.tar.bz2.sig Source3: baselibs.conf +Patch1: nfq-stray-var.diff + BuildRoot: %{_tmppath}/%{name}-%{version}-build +%if !(0%{?suse_version} >= 1210) +%define oldgcc 1 +%endif +%if 0%{?oldgcc} BuildRequires: autoconf BuildRequires: automake >= 1.6 +%endif BuildRequires: libtool BuildRequires: pkgconfig >= 0.21 %if 0%{?suse_version} >= 1140 @@ -73,10 +80,18 @@ libnetfilter_queue has been previously known as libnfnetlink_queue. %prep %setup -q +%if 0%{?oldgcc} +%patch -P 1 -p1 +%endif %build if [ ! -e configure ]; then - ./autogen.sh; + autoreconf -fi; +else + :; +%if 0%{?oldgcc} + autoreconf -fi; +%endif fi; %configure --disable-static --includedir=%_includedir/%name-%version make %{?_smp_mflags} diff --git a/nfq-stray-var.diff b/nfq-stray-var.diff new file mode 100644 index 0000000..ebae671 --- /dev/null +++ b/nfq-stray-var.diff @@ -0,0 +1,32 @@ +parent 7bd9edfe7849d8d1bc35f9ac28e949409da0bf10 (libnetfilter_queue-1.0.1-2-g7bd9edf) +commit 2c481c1fd73bb744957b2e5c5161c7a0804ab2e4 +Author: Jan Engelhardt +Date: Sat Jun 30 02:28:25 2012 +0200 + +build: remove stray empty variable + +Compilation can fail when libnfnetlink is not in a directory searched +by default. Reason is the empty KERNELDIR variable which makes for a +gcc command like: + + gcc -I. -I../include -I -Wall -I/usr/include/libnfnetlink-1.0.0+git28 + -Wall -c libnetfilter_queue.c + +What one would expect is that gcc would search in the (non-existent) +directory "-Wall" and just continue as usual, since -Wall is specified +again. Instead, gcc versions before 4.6 attempt to search the +(similarly non-existent) directory "-I/usr/[...]" and thus miss. + +Signed-off-by: Jan Engelhardt +--- + Make_global.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: libnetfilter_queue-1.0.1/Make_global.am +=================================================================== +--- libnetfilter_queue-1.0.1.orig/Make_global.am ++++ libnetfilter_queue-1.0.1/Make_global.am +@@ -1,2 +1,2 @@ +-AM_CPPFLAGS = -I${top_srcdir}/include -I${KERNELDIR} ++AM_CPPFLAGS = -I${top_srcdir}/include + AM_CFLAGS = -Wall ${LIBNFNETLINK_CFLAGS} From b1127d4bf014d3b2a2c2a0318963ae21e915398161bbfc8db58abca8dfb9ef08 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 30 Jun 2012 18:16:02 +0000 Subject: [PATCH 4/6] Simplify broken Makefile workaround OBS-URL: https://build.opensuse.org/package/show/security:netfilter/libnetfilter_queue?expand=0&rev=25 --- libnetfilter_queue.spec | 41 +++++++++++------------------------------ nfq-stray-var.diff | 32 -------------------------------- 2 files changed, 11 insertions(+), 62 deletions(-) delete mode 100644 nfq-stray-var.diff diff --git a/libnetfilter_queue.spec b/libnetfilter_queue.spec index 108459a..1dfbf4d 100644 --- a/libnetfilter_queue.spec +++ b/libnetfilter_queue.spec @@ -17,7 +17,7 @@ Name: libnetfilter_queue -%define libsoname %{name}1 +%define lname libnetfilter_queue1 Version: 1.0.1 Release: 0 Summary: Userspace library for packets that have been queued by the kernel packet filter @@ -29,19 +29,11 @@ Url: http://netfilter.org/projects/libnetfilter_queue/ Source: ftp://ftp.netfilter.org/pub/libnetfilter_queue/%name-%version.tar.bz2 Source2: ftp://ftp.netfilter.org/pub/libnetfilter_queue/%name-%version.tar.bz2.sig Source3: baselibs.conf -Patch1: nfq-stray-var.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build -%if !(0%{?suse_version} >= 1210) -%define oldgcc 1 -%endif -%if 0%{?oldgcc} -BuildRequires: autoconf -BuildRequires: automake >= 1.6 -%endif -BuildRequires: libtool +#BuildRequires: libtool BuildRequires: pkgconfig >= 0.21 -%if 0%{?suse_version} >= 1140 +%if 0%{?suse_version} >= 1140 || 0%{?fedora_version} BuildRequires: pkgconfig(libnfnetlink) >= 0.0.41 %else BuildRequires: libnfnetlink-devel >= 0.0.41 @@ -54,11 +46,11 @@ system that deprecates the old ip_queue / libipq mechanism. libnetfilter_queue has been previously known as libnfnetlink_queue. -%package -n %libsoname +%package -n %lname Summary: Userspace library for packets that have been queued by the kernel packet filter Group: System/Libraries -%description -n %libsoname +%description -n %lname 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. @@ -66,7 +58,7 @@ system that deprecates the old ip_queue / libipq mechanism. libnetfilter_queue has been previously known as libnfnetlink_queue. %package devel -Requires: %libsoname = %version +Requires: %lname = %version Requires: libnfnetlink-devel Summary: Userspace library for packets that have been queued by the kernel packet filter Group: Development/Libraries/C and C++ @@ -80,31 +72,20 @@ libnetfilter_queue has been previously known as libnfnetlink_queue. %prep %setup -q -%if 0%{?oldgcc} -%patch -P 1 -p1 -%endif %build -if [ ! -e configure ]; then - autoreconf -fi; -else - :; -%if 0%{?oldgcc} - autoreconf -fi; -%endif -fi; %configure --disable-static --includedir=%_includedir/%name-%version -make %{?_smp_mflags} +make %{?_smp_mflags} KERNELDIR="ignore"; %install -make install DESTDIR="%buildroot"; +make install DESTDIR="%buildroot" KERNELDIR="ignore"; rm -f "%buildroot/%_libdir"/*.la; -%post -n %libsoname -p /sbin/ldconfig +%post -n %lname -p /sbin/ldconfig -%postun -n %libsoname -p /sbin/ldconfig +%postun -n %lname -p /sbin/ldconfig -%files -n %libsoname +%files -n %lname %defattr(-,root,root) %_libdir/libnetfilter_queue.so.1* diff --git a/nfq-stray-var.diff b/nfq-stray-var.diff deleted file mode 100644 index ebae671..0000000 --- a/nfq-stray-var.diff +++ /dev/null @@ -1,32 +0,0 @@ -parent 7bd9edfe7849d8d1bc35f9ac28e949409da0bf10 (libnetfilter_queue-1.0.1-2-g7bd9edf) -commit 2c481c1fd73bb744957b2e5c5161c7a0804ab2e4 -Author: Jan Engelhardt -Date: Sat Jun 30 02:28:25 2012 +0200 - -build: remove stray empty variable - -Compilation can fail when libnfnetlink is not in a directory searched -by default. Reason is the empty KERNELDIR variable which makes for a -gcc command like: - - gcc -I. -I../include -I -Wall -I/usr/include/libnfnetlink-1.0.0+git28 - -Wall -c libnetfilter_queue.c - -What one would expect is that gcc would search in the (non-existent) -directory "-Wall" and just continue as usual, since -Wall is specified -again. Instead, gcc versions before 4.6 attempt to search the -(similarly non-existent) directory "-I/usr/[...]" and thus miss. - -Signed-off-by: Jan Engelhardt ---- - Make_global.am | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -Index: libnetfilter_queue-1.0.1/Make_global.am -=================================================================== ---- libnetfilter_queue-1.0.1.orig/Make_global.am -+++ libnetfilter_queue-1.0.1/Make_global.am -@@ -1,2 +1,2 @@ --AM_CPPFLAGS = -I${top_srcdir}/include -I${KERNELDIR} -+AM_CPPFLAGS = -I${top_srcdir}/include - AM_CFLAGS = -Wall ${LIBNFNETLINK_CFLAGS} From ba73d408f3afcb8ae5b1bb4469a017567c452f4b79975bb8bd025ac9c3e72764 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Mon, 8 Oct 2012 12:31:49 +0000 Subject: [PATCH 5/6] libnetfilter_queue-1.0.2 OBS-URL: https://build.opensuse.org/package/show/security:netfilter/libnetfilter_queue?expand=0&rev=26 --- libnetfilter_queue-1.0.1.tar.bz2 | 3 --- libnetfilter_queue-1.0.1.tar.bz2.sig | Bin 543 -> 0 bytes libnetfilter_queue-1.0.2.tar.bz2 | 3 +++ libnetfilter_queue-1.0.2.tar.bz2.sig | Bin 0 -> 543 bytes libnetfilter_queue.changes | 6 ++++++ libnetfilter_queue.spec | 11 +++++++---- 6 files changed, 16 insertions(+), 7 deletions(-) delete mode 100644 libnetfilter_queue-1.0.1.tar.bz2 delete mode 100644 libnetfilter_queue-1.0.1.tar.bz2.sig create mode 100644 libnetfilter_queue-1.0.2.tar.bz2 create mode 100644 libnetfilter_queue-1.0.2.tar.bz2.sig diff --git a/libnetfilter_queue-1.0.1.tar.bz2 b/libnetfilter_queue-1.0.1.tar.bz2 deleted file mode 100644 index ad923f5..0000000 --- a/libnetfilter_queue-1.0.1.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:cfda0aa4f05b93850df1d29b16b5601e7ceccf000e8ddc1abb7477761c4426aa -size 262048 diff --git a/libnetfilter_queue-1.0.1.tar.bz2.sig b/libnetfilter_queue-1.0.1.tar.bz2.sig deleted file mode 100644 index 4a9cc00f2b80b62628c6c50cf2a9f313c7c101d91b623ab4e6f20c71d761aea9..0000000000000000000000000000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 543 zcmV+)0^t3L0vrSY0RjL91p-e3CsP0l2@s?aABnqPSj5>g1l2@u`8nVrJ5P&<4>QWK)?j&)G^OvaCh`5*3Y8NO;9*mi>Lcnpp{b)0(dn};*^qUbvF_hqfG#LBJICpgiP8*LiM3%$&EHzM~ z{j`DRa=JS@TRt1Rp`l%v&VOmzQ9rYV_Q(^16o>LpmyfMJ?#ilmt==qN23es@8BwwW z#IM@4$u0A-t*GVimPA?lZ#J#{dSD!_fGL7NN8IKZC+a<`vQ8f*4hhXff2H>|AIz)s z>+Kuo!{z-3Lgx|zV6<~)=nEtE8MW8J*XG4Pkp_o1Mn%Tr;Nm*mt7XR%y#{VM&Zkut z@aYEP5?GYuMcaet3~*4}B2I1G>G%%frP-`Oj%{dO*~JM+Tw3lRamRU>j&8&|=~2tECDvqf6W}Ibi=AMD zT6Wc6d0qT5O^wjCKvtI{<&JTU3|>vJKDj<(b#Y(8HFjhYdGGi}&U?dJN_|ehne>L} hpueYMFj$=gfz{0Vt*i{8*_z!`LAh6S?+@Tl>9=eU3L*di diff --git a/libnetfilter_queue-1.0.2.tar.bz2 b/libnetfilter_queue-1.0.2.tar.bz2 new file mode 100644 index 0000000..807444b --- /dev/null +++ b/libnetfilter_queue-1.0.2.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:838490eb5dbe358f9669823704982f5313a8d397111562373200203f93ac1a32 +size 354201 diff --git a/libnetfilter_queue-1.0.2.tar.bz2.sig b/libnetfilter_queue-1.0.2.tar.bz2.sig new file mode 100644 index 0000000000000000000000000000000000000000000000000000000000000000..042a1639f737aa4be42ddd01557825cbf91b9e90950fd81cdb82483b65dca4f5 GIT binary patch literal 543 zcmV+)0^t3L0vrSY0RjL91p-iVtY-iU2@s?aABnqPSj^6~5C49!LxIh@P%9uz5w^Bp z+tUPvTYTSxEn1JYxIGI=I(kVNWzSe#q$!`6g(Kmq-pnh!Qf$MyQ!3T4>8cw;1l2eu z4qKXS8@=JZ(tW;a%AHhm^^{isBjBlV88w{>3ehdJ_LJ4r%yQa=(2 zsdEWFEhe4tn?KAn^=}3u<#62LFCcn?ptr+Ed5P>^*%C)gDcU!I5eW&)SJxK3>8WMx z;S2BPazoa^-Hs#a%PwowaT%`*x`>i?CpYt>sNBnYM~p@TrZtr>L5(Sa^WmAE3Th-u zShY6a5)(|Hk=(ho=J_vMdc0=fuBCuqWJzvU_1qa7H-TzPI{9a9iC>I4E}?>ep*(&U z=^YRKMh%Qq5r*JO{{1@ARfZM4ObU&x0aAWzA?}(OWxB8Ziey)#rQ+e{2`?Lj4B(Ac z7>C;Z@C^{p4Rd)%6hA!`By;rzBrSKR$5W3EUGzanQF1=eF|aB?RseX(mvmdsr6b1v zULnn74w2=-Z}d7M_mJd7nra6T8(>?GgE6OlU662=E86~if#;@+U_= 0.21 %if 0%{?suse_version} >= 1140 || 0%{?fedora_version} +BuildRequires: pkgconfig(libmnl) >= 1.0.3 BuildRequires: pkgconfig(libnfnetlink) >= 0.0.41 %else +BuildRequires: libmnl-devel >= 1.0.3 BuildRequires: libnfnetlink-devel >= 0.0.41 %endif From dda62653dddb2f256fb7cef5e04b375bb71148e93bb11f5097a27b9b569bba72 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 9 Oct 2012 01:02:44 +0000 Subject: [PATCH 6/6] RHEL6 workarounds OBS-URL: https://build.opensuse.org/package/show/security:netfilter/libnetfilter_queue?expand=0&rev=27 --- libnetfilter_queue.spec | 2 ++ rhel6-iptos.diff | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 rhel6-iptos.diff diff --git a/libnetfilter_queue.spec b/libnetfilter_queue.spec index 60f2e60..1cbe254 100644 --- a/libnetfilter_queue.spec +++ b/libnetfilter_queue.spec @@ -30,6 +30,7 @@ Url: http://netfilter.org/projects/libnetfilter_queue/ Source: http://netfilter.org/projects/libnetfilter_queue/files/%name-%version.tar.bz2 Source2: http://netfilter.org/projects/libnetfilter_queue/files/%name-%version.tar.bz2.sig Source3: baselibs.conf +Patch1: rhel6-iptos.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build #BuildRequires: libtool @@ -75,6 +76,7 @@ libnetfilter_queue has been previously known as libnfnetlink_queue. %prep %setup -q +%patch -P 1 -p1 %build %configure --disable-static --includedir=%_includedir/%name-%version diff --git a/rhel6-iptos.diff b/rhel6-iptos.diff new file mode 100644 index 0000000..0998f56 --- /dev/null +++ b/rhel6-iptos.diff @@ -0,0 +1,34 @@ +From: Jan Engelhardt +Date: 2012-10-09 02:46:29.418099680 +0200 +Upstream: never + +glibc before version 2.13 has a bug in netinet/ip.h: + +#define IPTOS_CLASS(class) ((tos) & IPTOS_CLASS_MASK) + +Namely, it does not use "class", but "tos". And þe olde RHEL 6 +even ships that... bleh. + +--- + src/extra/ipv4.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +Index: libnetfilter_queue-1.0.2/src/extra/ipv4.c +=================================================================== +--- libnetfilter_queue-1.0.2.orig/src/extra/ipv4.c ++++ libnetfilter_queue-1.0.2/src/extra/ipv4.c +@@ -133,12 +133,13 @@ int nfq_ip_snprintf(char *buf, size_t si + int ret; + struct in_addr src = { iph->saddr }; + struct in_addr dst = { iph->daddr }; ++ unsigned int tos = iph->tos; + + 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), + ntohs(iph->tot_len), IPTOS_TOS(iph->tos), +- IPTOS_PREC(iph->tos), iph->ttl, ntohs(iph->id), ++ IPTOS_PREC(tos), iph->ttl, ntohs(iph->id), + iph->protocol); + + return ret;