From 8c771458ba29f36c441cbd081d34e72b84c7dcfb Mon Sep 17 00:00:00 2001 From: kosmo Date: Sat, 13 Aug 2011 12:00:24 +0000 Subject: [PATCH] - ipset: Fix interface name matching in hash:net,iface. Changed files: ipset-hash-net-if-fix.patch -> 1.1 ipset.spec -> 1.126 --- ipset-hash-net-if-fix.patch | 30 ++++++++++++++++++++++++++++++ ipset.spec | 2 ++ 2 files changed, 32 insertions(+) create mode 100644 ipset-hash-net-if-fix.patch diff --git a/ipset-hash-net-if-fix.patch b/ipset-hash-net-if-fix.patch new file mode 100644 index 0000000..dc75fb7 --- /dev/null +++ b/ipset-hash-net-if-fix.patch @@ -0,0 +1,30 @@ +diff -urN ipset-6.8.orig/kernel/net/netfilter/ipset/ip_set_hash_netiface.c ipset-6.8/kernel/net/netfilter/ipset/ip_set_hash_netiface.c +--- ipset-6.8.orig/kernel/net/netfilter/ipset/ip_set_hash_netiface.c 2011-07-08 10:13:53.000000000 +0200 ++++ ipset-6.8/kernel/net/netfilter/ipset/ip_set_hash_netiface.c 2011-08-13 09:58:01.456999822 +0200 +@@ -41,25 +41,7 @@ + static inline long + ifname_compare(const char *_a, const char *_b) + { +- const long *a = (const long *)_a; +- const long *b = (const long *)_b; +- +- BUILD_BUG_ON(IFNAMSIZ > 4 * sizeof(unsigned long)); +- if (a[0] != b[0]) +- return a[0] - b[0]; +- if (IFNAMSIZ > sizeof(long)) { +- if (a[1] != b[1]) +- return a[1] - b[1]; +- } +- if (IFNAMSIZ > 2 * sizeof(long)) { +- if (a[2] != b[2]) +- return a[2] - b[2]; +- } +- if (IFNAMSIZ > 3 * sizeof(long)) { +- if (a[3] != b[3]) +- return a[3] - b[3]; +- } +- return 0; ++ return strcmp(_a, _b); + } + + static void diff --git a/ipset.spec b/ipset.spec index df36ee8..b359e4a 100644 --- a/ipset.spec +++ b/ipset.spec @@ -35,6 +35,7 @@ Source0: http://ipset.netfilter.org/%{pname}-%{version}.tar.bz2 Source1: %{pname}.init Patch0: %{pname}-config_dist.patch Patch1: %{pname}-no_kernel.patch +Patch2: %{pname}-hash-net-if-fix.patch URL: http://ipset.netfilter.org/ BuildRequires: autoconf >= 2.50 BuildRequires: automake @@ -138,6 +139,7 @@ Ten pakiet zawiera moduły jądra oferujące wsparcie dla zbiorów IP. %else %patch1 -p1 %endif +%patch2 -p1 %build %{__libtoolize} -- 2.44.0