]> granicus.if.org Git - ipset/commitdiff
netlink: add netlink_dump_control structure for netlink_dump_start()
authorPablo Neira Ayuso <pablo@netfilter.org>
Thu, 10 May 2012 09:12:24 +0000 (11:12 +0200)
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Thu, 10 May 2012 09:12:24 +0000 (11:12 +0200)
Backport of Pablo's patch to the ipset package.

kernel/net/netfilter/ipset/ip_set_core.c

index 51ceea5dda9352997c78882b839b648d257f10b0..27f35acf636c0ece2a6f4e6c16f4f3a36ff9dcfb 100644 (file)
@@ -1172,12 +1172,22 @@ ip_set_dump(struct sock *ctnl, struct sk_buff *skb,
        if (unlikely(protocol_failed(attr)))
                return -IPSET_ERR_PROTOCOL;
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 1, 0)
        return netlink_dump_start(ctnl, skb, nlh,
                                  ip_set_dump_start,
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 1, 0)
                                  ip_set_dump_done);
-#else
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0)
+       return netlink_dump_start(ctnl, skb, nlh,
+                                 ip_set_dump_start,
                                  ip_set_dump_done, 0);
+#else
+       {
+               struct netlink_dump_control c = {
+                       .dump = ip_set_dump_start,
+                       .done = ip_set_dump_done,
+               };
+               return netlink_dump_start(ctnl, skb, nlh, &c);
+       }
 #endif
 }