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;