[packages/ipset] - add upstream patch to fix building with linux 4.7 - rel 2

baggins baggins at pld-linux.org
Mon Aug 1 20:50:38 CEST 2016


commit a62cbe338c656e687e2c6f560258ab28c27f18bc
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Mon Aug 1 20:50:06 2016 +0200

    - add upstream patch to fix building with linux 4.7
    - rel 2

 ...ckports-for-the-nla_put_net64-API-changes.patch | 97 ++++++++++++++++++++++
 ipset.spec                                         |  8 +-
 2 files changed, 104 insertions(+), 1 deletion(-)
---
diff --git a/ipset.spec b/ipset.spec
index 362b56f..c8f3d38 100644
--- a/ipset.spec
+++ b/ipset.spec
@@ -22,7 +22,7 @@ exit 1
 %define		_enable_debug_packages	0
 %endif
 
-%define		rel	1
+%define		rel	2
 %define		pname	ipset
 Summary:	IP sets utility
 Summary(pl.UTF-8):	Narzędzie do zarządzania zbiorami IP
@@ -35,6 +35,7 @@ Group:		Networking/Admin
 Source0:	http://ipset.netfilter.org/%{pname}-%{version}.tar.bz2
 # Source0-md5:	fd8ea35997115c5c630eee22f0beecec
 Source1:	%{pname}.init
+Patch0:		%{pname}-Backports-for-the-nla_put_net64-API-changes.patch
 URL:		http://ipset.netfilter.org/
 BuildRequires:	autoconf >= 2.50
 BuildRequires:	automake
@@ -172,8 +173,13 @@ done\
 
 %prep
 %setup -q -n %{pname}-%{version}
+%patch0 -p1
 
 %build
+%{__aclocal}
+%{__autoconf}
+%{__autoheader}
+%{__automake}
 %if %{with userspace}
 %configure \
 	--disable-silent-rules \
diff --git a/ipset-Backports-for-the-nla_put_net64-API-changes.patch b/ipset-Backports-for-the-nla_put_net64-API-changes.patch
new file mode 100644
index 0000000..7dbb7b2
--- /dev/null
+++ b/ipset-Backports-for-the-nla_put_net64-API-changes.patch
@@ -0,0 +1,97 @@
+diff --git a/configure.ac b/configure.ac
+index 7156ab8..b73b3cc 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -250,6 +250,16 @@ else
+ 	AC_SUBST(HAVE_NLA_PUT_BE64, undef)
+ fi
+ 
++AC_MSG_CHECKING([kernel source for nla_put_64bit])
++if test -f $ksourcedir/include/net/netlink.h && \
++   $GREP -q 'nla_put_64bit' $ksourcedir/include/net/netlink.h; then
++	AC_MSG_RESULT(yes)
++	AC_SUBST(HAVE_NLA_PUT_64BIT, define)
++else
++	AC_MSG_RESULT(no)
++	AC_SUBST(HAVE_NLA_PUT_64BIT, undef)
++fi
++
+ AC_MSG_CHECKING([kernel source for portid in nl_info])
+ if test -f $ksourcedir/include/linux/netlink.h && \
+    $AWK '/^struct netlink_skb_parms/ {for(i=1; i<=5; i++) {getline; print}}' $ksourcedir/include/linux/netlink.h | $GREP -q 'portid;'; then
+diff --git a/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in b/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in
+index 15d0763..fe24255 100644
+--- a/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in
++++ b/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in
+@@ -10,6 +10,7 @@
+ #@HAVE_ETHER_ADDR_EQUAL@ HAVE_ETHER_ADDR_EQUAL
+ #@HAVE_NLA_PUT_BE16@ HAVE_NLA_PUT_BE16
+ #@HAVE_NLA_PUT_BE64@ HAVE_NLA_PUT_BE64
++#@HAVE_NLA_PUT_64BIT@ HAVE_NLA_PUT_64BIT
+ #@HAVE_NL_INFO_PORTID@ HAVE_NL_INFO_PORTID
+ #define HAVE_NETLINK_DUMP_START_ARGS	@HAVE_NETLINK_DUMP_START_ARGS@
+ #@HAVE_NS_CAPABLE@ HAVE_NS_CAPABLE
+@@ -160,6 +161,12 @@ static inline int nla_put_net64(struct sk_buff *skb, int attrtype, __be64 value)
+ }
+ #endif
+ 
++#ifdef HAVE_NLA_PUT_64BIT
++#define IPSET_NLA_PUT_NET64(skb, t, v, pa) nla_put_be64(skb, t, v, pa)
++#else
++#define IPSET_NLA_PUT_NET64(skb, t, v, pa) nla_put_be64(skb, t, v)
++#endif
++
+ #ifdef HAVE_NL_INFO_PORTID
+ #define NETLINK_PORTID(skb)	NETLINK_CB(skb).portid
+ #else
+diff --git a/kernel/include/linux/netfilter/ipset/ip_set_counter.h b/kernel/include/linux/netfilter/ipset/ip_set_counter.h
+index d61e0e5..f2f1e8f 100644
+--- a/kernel/include/linux/netfilter/ipset/ip_set_counter.h
++++ b/kernel/include/linux/netfilter/ipset/ip_set_counter.h
+@@ -53,10 +53,12 @@ ip_set_update_counter(struct ip_set_counter *counter,
+ static inline bool
+ ip_set_put_counter(struct sk_buff *skb, const struct ip_set_counter *counter)
+ {
+-	return nla_put_net64(skb, IPSET_ATTR_BYTES,
+-			     cpu_to_be64(ip_set_get_bytes(counter))) ||
+-	       nla_put_net64(skb, IPSET_ATTR_PACKETS,
+-			     cpu_to_be64(ip_set_get_packets(counter)));
++	return IPSET_NLA_PUT_NET64(skb, IPSET_ATTR_BYTES,
++				   cpu_to_be64(ip_set_get_bytes(counter)),
++				   IPSET_ATTR_PAD) ||
++	       IPSET_NLA_PUT_NET64(skb, IPSET_ATTR_PACKETS,
++				   cpu_to_be64(ip_set_get_packets(counter)),
++				   IPSET_ATTR_PAD);
+ }
+ 
+ static inline void
+diff --git a/kernel/include/linux/netfilter/ipset/ip_set_skbinfo.h b/kernel/include/linux/netfilter/ipset/ip_set_skbinfo.h
+index b03dd6a..c6df3a1 100644
+--- a/kernel/include/linux/netfilter/ipset/ip_set_skbinfo.h
++++ b/kernel/include/linux/netfilter/ipset/ip_set_skbinfo.h
+@@ -23,9 +23,10 @@ ip_set_put_skbinfo(struct sk_buff *skb, const struct ip_set_skbinfo *skbinfo)
+ {
+ 	/* Send nonzero parameters only */
+ 	return ((skbinfo->skbmark || skbinfo->skbmarkmask) &&
+-		nla_put_net64(skb, IPSET_ATTR_SKBMARK,
+-			      cpu_to_be64((u64)skbinfo->skbmark << 32 |
+-					  skbinfo->skbmarkmask))) ||
++		IPSET_NLA_PUT_NET64(skb, IPSET_ATTR_SKBMARK,
++				    cpu_to_be64((u64)skbinfo->skbmark << 32 |
++						skbinfo->skbmarkmask),
++				    IPSET_ATTR_PAD)) ||
+ 	       (skbinfo->skbprio &&
+ 		nla_put_net32(skb, IPSET_ATTR_SKBPRIO,
+ 			      cpu_to_be32(skbinfo->skbprio))) ||
+diff --git a/kernel/include/uapi/linux/netfilter/ipset/ip_set.h b/kernel/include/uapi/linux/netfilter/ipset/ip_set.h
+index def91b9..4a6776f 100644
+--- a/kernel/include/uapi/linux/netfilter/ipset/ip_set.h
++++ b/kernel/include/uapi/linux/netfilter/ipset/ip_set.h
+@@ -118,6 +118,7 @@ enum {
+ 	IPSET_ATTR_SKBMARK,
+ 	IPSET_ATTR_SKBPRIO,
+ 	IPSET_ATTR_SKBQUEUE,
++	IPSET_ATTR_PAD,
+ 	__IPSET_ATTR_ADT_MAX,
+ };
+ #define IPSET_ATTR_ADT_MAX	(__IPSET_ATTR_ADT_MAX - 1)
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ipset.git/commitdiff/a62cbe338c656e687e2c6f560258ab28c27f18bc



More information about the pld-cvs-commit mailing list