- fix building with kernel 4.12 auto/th/ipset-6.32-2
authorJan Rękorajski <baggins@pld-linux.org>
Tue, 1 Aug 2017 13:23:42 +0000 (15:23 +0200)
committerJan Rękorajski <baggins@pld-linux.org>
Tue, 1 Aug 2017 13:23:42 +0000 (15:23 +0200)
- rel 2

ipset.spec
linux-4.12.patch [new file with mode: 0644]

index a41ce94876655d32527c92c456e87c7f54ed11c7..0e841c5e56e4353ec54cc7b9095733508f431d77 100644 (file)
@@ -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
@@ -36,6 +36,7 @@ Source0:      http://ipset.netfilter.org/%{pname}-%{version}.tar.bz2
 # Source0-md5: 857a5c6a6d645196865a82bf6fd7f567
 Source1:       %{pname}.init
 Patch0:                linux-4.10.patch
+Patch1:                linux-4.12.patch
 URL:           http://ipset.netfilter.org/
 BuildRequires: autoconf >= 2.50
 BuildRequires: automake
@@ -187,6 +188,7 @@ done\
 %prep
 %setup -q -n %{pname}-%{version}
 %patch0 -p1
+%patch1 -p1
 
 %build
 %{__aclocal}
diff --git a/linux-4.12.patch b/linux-4.12.patch
new file mode 100644 (file)
index 0000000..cf6b9f0
--- /dev/null
@@ -0,0 +1,134 @@
+--- ipset-6.32/kernel/net/netfilter/ipset/ip_set_core.c.orig   2017-08-01 15:16:35.420874095 +0200
++++ ipset-6.32/kernel/net/netfilter/ipset/ip_set_core.c        2017-08-01 15:20:22.597111757 +0200
+@@ -300,7 +300,11 @@
+       if (unlikely(!flag_nested(nla)))
+               return -IPSET_ERR_PROTOCOL;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)
++      if (nla_parse_nested(tb, IPSET_ATTR_IPADDR_MAX, nla, ipaddr_policy, NULL))
++#else
+       if (nla_parse_nested(tb, IPSET_ATTR_IPADDR_MAX, nla, ipaddr_policy))
++#endif
+               return -IPSET_ERR_PROTOCOL;
+       if (unlikely(!ip_set_attr_netorder(tb, IPSET_ATTR_IPADDR_IPV4)))
+               return -IPSET_ERR_PROTOCOL;
+@@ -318,7 +322,11 @@
+       if (unlikely(!flag_nested(nla)))
+               return -IPSET_ERR_PROTOCOL;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)
++      if (nla_parse_nested(tb, IPSET_ATTR_IPADDR_MAX, nla, ipaddr_policy, NULL))
++#else
+       if (nla_parse_nested(tb, IPSET_ATTR_IPADDR_MAX, nla, ipaddr_policy))
++#endif
+               return -IPSET_ERR_PROTOCOL;
+       if (unlikely(!ip_set_attr_netorder(tb, IPSET_ATTR_IPADDR_IPV6)))
+               return -IPSET_ERR_PROTOCOL;
+@@ -914,7 +922,11 @@
+       /* Without holding any locks, create private part. */
+       if (attr[IPSET_ATTR_DATA] &&
+           nla_parse_nested(tb, IPSET_ATTR_CREATE_MAX, attr[IPSET_ATTR_DATA],
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)
++                           set->type->create_policy, NULL)) {
++#else
+                            set->type->create_policy)) {
++#endif
+               ret = -IPSET_ERR_PROTOCOL;
+               goto put_out;
+       }
+@@ -1270,7 +1282,11 @@
+       /* Second pass, so parser can't fail */
+       nla_parse(cda, IPSET_ATTR_CMD_MAX,
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)
++                attr, nlh->nlmsg_len - min_len, ip_set_setname_policy, NULL);
++#else
+                 attr, nlh->nlmsg_len - min_len, ip_set_setname_policy);
++#endif
+       if (cda[IPSET_ATTR_SETNAME]) {
+               struct ip_set *set;
+@@ -1333,7 +1333,11 @@
+                        * manually :-(
+                        */
+                       if (nlh->nlmsg_flags & NLM_F_ACK)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)
++                              netlink_ack(cb->skb, nlh, ret, NULL);
++#else
+                               netlink_ack(cb->skb, nlh, ret);
++#endif
+                       return ret;
+               }
+       }
+@@ -1526,7 +1542,11 @@
+               nla_parse(cda, IPSET_ATTR_CMD_MAX,
+                         cmdattr, nlh->nlmsg_len - min_len,
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)
++                        ip_set_adt_policy, NULL);
++#else
+                         ip_set_adt_policy);
++#endif
+               errline = nla_data(cda[IPSET_ATTR_LINENO]);
+@@ -1573,7 +1593,11 @@
+       if (attr[IPSET_ATTR_DATA]) {
+               if (nla_parse_nested(tb, IPSET_ATTR_ADT_MAX,
+                                    attr[IPSET_ATTR_DATA],
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)
++                                   set->type->adt_policy, NULL))
++#else
+                                    set->type->adt_policy))
++#endif
+                       return -IPSET_ERR_PROTOCOL;
+               ret = call_ad(ctnl, skb, set, tb, IPSET_ADD, flags,
+                             use_lineno);
+@@ -1585,7 +1609,11 @@
+                       if (nla_type(nla) != IPSET_ATTR_DATA ||
+                           !flag_nested(nla) ||
+                           nla_parse_nested(tb, IPSET_ATTR_ADT_MAX, nla,
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)
++                                           set->type->adt_policy, NULL))
++#else
+                                            set->type->adt_policy))
++#endif
+                               return -IPSET_ERR_PROTOCOL;
+                       ret = call_ad(ctnl, skb, set, tb, IPSET_ADD,
+                                     flags, use_lineno);
+@@ -1628,7 +1656,11 @@
+       if (attr[IPSET_ATTR_DATA]) {
+               if (nla_parse_nested(tb, IPSET_ATTR_ADT_MAX,
+                                    attr[IPSET_ATTR_DATA],
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)
++                                   set->type->adt_policy, NULL))
++#else
+                                    set->type->adt_policy))
++#endif
+                       return -IPSET_ERR_PROTOCOL;
+               ret = call_ad(ctnl, skb, set, tb, IPSET_DEL, flags,
+                             use_lineno);
+@@ -1640,7 +1672,11 @@
+                       if (nla_type(nla) != IPSET_ATTR_DATA ||
+                           !flag_nested(nla) ||
+                           nla_parse_nested(tb, IPSET_ATTR_ADT_MAX, nla,
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)
++                                           set->type->adt_policy, NULL))
++#else
+                                            set->type->adt_policy))
++#endif
+                               return -IPSET_ERR_PROTOCOL;
+                       ret = call_ad(ctnl, skb, set, tb, IPSET_DEL,
+                                     flags, use_lineno);
+@@ -1673,7 +1709,11 @@
+               return -ENOENT;
+       if (nla_parse_nested(tb, IPSET_ATTR_ADT_MAX, attr[IPSET_ATTR_DATA],
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)
++                           set->type->adt_policy, NULL))
++#else
+                            set->type->adt_policy))
++#endif
+               return -IPSET_ERR_PROTOCOL;
+       rcu_read_lock_bh();
This page took 0.10899 seconds and 4 git commands to generate.