From: Jan Rękorajski Date: Sat, 25 Mar 2017 19:46:18 +0000 (+0100) Subject: - up to 6.32 X-Git-Tag: auto/th/ipset-6.32-1 X-Git-Url: http://git.pld-linux.org/gitweb.cgi?a=commitdiff_plain;h=68e8d3c68363ddf63f4ca2f785929f3659537cbb;p=packages%2Fipset.git - up to 6.32 - fix building with linux 4.10 --- diff --git a/ipset.spec b/ipset.spec index 782ac20..a41ce94 100644 --- a/ipset.spec +++ b/ipset.spec @@ -27,14 +27,15 @@ exit 1 Summary: IP sets utility Summary(pl.UTF-8): Narzędzie do zarządzania zbiorami IP Name: %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel} -Version: 6.30 +Version: 6.32 Release: %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}} License: GPL v2 Group: Networking/Admin #Source0Download: http://ipset.netfilter.org/install.html Source0: http://ipset.netfilter.org/%{pname}-%{version}.tar.bz2 -# Source0-md5: 41c32e3b884ec714f0aac95e7675f9d1 +# Source0-md5: 857a5c6a6d645196865a82bf6fd7f567 Source1: %{pname}.init +Patch0: linux-4.10.patch URL: http://ipset.netfilter.org/ BuildRequires: autoconf >= 2.50 BuildRequires: automake @@ -185,6 +186,7 @@ done\ %prep %setup -q -n %{pname}-%{version} +%patch0 -p1 %build %{__aclocal} diff --git a/linux-4.10.patch b/linux-4.10.patch new file mode 100644 index 0000000..25a1a8d --- /dev/null +++ b/linux-4.10.patch @@ -0,0 +1,139 @@ +--- ipset-6.32/kernel/net/netfilter/xt_set.c.orig 2017-03-12 18:41:03.000000000 +0100 ++++ ipset-6.32/kernel/net/netfilter/xt_set.c 2017-03-25 20:09:19.407499549 +0100 +@@ -72,7 +72,7 @@ + { + const struct xt_set_info_match_v0 *info = par->matchinfo; + +- ADT_OPT(opt, par->family, info->match_set.u.compat.dim, ++ ADT_OPT(opt, xt_family(par), info->match_set.u.compat.dim, + info->match_set.u.compat.flags, 0, UINT_MAX); + + return match_set(info->match_set.index, skb, par, &opt, +@@ -135,7 +135,7 @@ + { + const struct xt_set_info_match_v1 *info = par->matchinfo; + +- ADT_OPT(opt, par->family, info->match_set.dim, ++ ADT_OPT(opt, xt_family(par), info->match_set.dim, + info->match_set.flags, 0, UINT_MAX); + + if (opt.flags & IPSET_RETURN_NOMATCH) +@@ -201,7 +201,7 @@ + const struct xt_set_info_match_v3 *info = par->matchinfo; + int ret; + +- ADT_OPT(opt, par->family, info->match_set.dim, ++ ADT_OPT(opt, xt_family(par), info->match_set.dim, + info->match_set.flags, info->flags, UINT_MAX); + + if (info->packets.op != IPSET_COUNTER_NONE || +@@ -248,7 +248,7 @@ + const struct xt_set_info_match_v4 *info = par->matchinfo; + int ret; + +- ADT_OPT(opt, par->family, info->match_set.dim, ++ ADT_OPT(opt, xt_family(par), info->match_set.dim, + info->match_set.flags, info->flags, UINT_MAX); + + if (info->packets.op != IPSET_COUNTER_NONE || +@@ -284,9 +284,9 @@ + { + const struct xt_set_info_target_v0 *info = par->targinfo; + +- ADT_OPT(add_opt, par->family, info->add_set.u.compat.dim, ++ ADT_OPT(add_opt, xt_family(par), info->add_set.u.compat.dim, + info->add_set.u.compat.flags, 0, UINT_MAX); +- ADT_OPT(del_opt, par->family, info->del_set.u.compat.dim, ++ ADT_OPT(del_opt, xt_family(par), info->del_set.u.compat.dim, + info->del_set.u.compat.flags, 0, UINT_MAX); + + if (info->add_set.index != IPSET_INVALID_ID) +@@ -362,9 +362,9 @@ + { + const struct xt_set_info_target_v1 *info = par->targinfo; + +- ADT_OPT(add_opt, par->family, info->add_set.dim, ++ ADT_OPT(add_opt, xt_family(par), info->add_set.dim, + info->add_set.flags, 0, UINT_MAX); +- ADT_OPT(del_opt, par->family, info->del_set.dim, ++ ADT_OPT(del_opt, xt_family(par), info->del_set.dim, + info->del_set.flags, 0, UINT_MAX); + + if (info->add_set.index != IPSET_INVALID_ID) +@@ -436,9 +436,9 @@ + { + const struct xt_set_info_target_v2 *info = par->targinfo; + +- ADT_OPT(add_opt, par->family, info->add_set.dim, ++ ADT_OPT(add_opt, xt_family(par), info->add_set.dim, + info->add_set.flags, info->flags, info->timeout); +- ADT_OPT(del_opt, par->family, info->del_set.dim, ++ ADT_OPT(del_opt, xt_family(par), info->del_set.dim, + info->del_set.flags, 0, UINT_MAX); + + /* Normalize to fit into jiffies */ +@@ -468,11 +468,11 @@ + const struct xt_set_info_target_v3 *info = par->targinfo; + int ret; + +- ADT_OPT(add_opt, par->family, info->add_set.dim, ++ ADT_OPT(add_opt, xt_family(par), info->add_set.dim, + info->add_set.flags, info->flags, info->timeout); +- ADT_OPT(del_opt, par->family, info->del_set.dim, ++ ADT_OPT(del_opt, xt_family(par), info->del_set.dim, + info->del_set.flags, 0, UINT_MAX); +- ADT_OPT(map_opt, par->family, info->map_set.dim, ++ ADT_OPT(map_opt, xt_family(par), info->map_set.dim, + info->map_set.flags, 0, UINT_MAX); + + /* Normalize to fit into jiffies */ +--- ipset-6.32/kernel/net/netfilter/ipset/ip_set_hash_netiface.c.orig 2017-03-12 18:41:03.000000000 +0100 ++++ ipset-6.32/kernel/net/netfilter/ipset/ip_set_hash_netiface.c 2017-03-25 20:21:11.890900536 +0100 +@@ -170,7 +170,8 @@ + ip4addrptr(skb, opt->flags & IPSET_DIM_ONE_SRC, &e.ip); + e.ip &= ip_set_netmask(e.cidr); + +-#define IFACE(dir) (par->dir ? par->dir->name : "") ++#define IFACEIN (xt_in(par) ? xt_in(par)->name : "") ++#define IFACEOUT (xt_out(par) ? xt_out(par)->name : "") + #define SRCDIR (opt->flags & IPSET_DIM_TWO_SRC) + + if (opt->cmdflags & IPSET_FLAG_PHYSDEV) { +@@ -184,7 +185,7 @@ + e.physdev = 1; + #endif + } else { +- STRLCPY(e.iface, SRCDIR ? IFACE(in) : IFACE(out)); ++ STRLCPY(e.iface, SRCDIR ? IFACEIN : IFACEOUT); + } + + if (strlen(e.iface) == 0) +@@ -392,7 +393,7 @@ + e.physdev = 1; + #endif + } else { +- STRLCPY(e.iface, SRCDIR ? IFACE(in) : IFACE(out)); ++ STRLCPY(e.iface, SRCDIR ? IFACEIN : IFACEOUT); + } + + if (strlen(e.iface) == 0) +--- ipset-6.32/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in.orig 2017-03-25 20:11:14.791803460 +0100 ++++ ipset-6.32/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in 2017-03-25 20:27:17.970438585 +0100 +@@ -285,10 +285,16 @@ + } + #endif + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0) ++#define xt_in(par) par->in ++#define xt_out(par) par->out ++#define xt_family(par) par->family ++#endif ++ + #ifdef HAVE_NET_IN_XT_ACTION_PARAM + #define IPSET_DEV_NET(par) (par)->net + #else +-#define IPSET_DEV_NET(par) dev_net((par)->in ? (par)->in : (par)->out) ++#define IPSET_DEV_NET(par) dev_net(xt_in(par) ? xt_in(par) : xt_out(par)) + #endif + + #ifndef smp_mb__before_atomic