Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-2.6
authorDavid S. Miller <davem@davemloft.net>
Tue, 19 Apr 2011 18:28:35 +0000 (11:28 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 19 Apr 2011 18:28:35 +0000 (11:28 -0700)
1  2 
net/netfilter/ipset/ip_set_core.c

@@@ -918,7 -918,7 +918,7 @@@ ip_set_swap(struct sock *ctnl, struct s
        to = ip_set_list[to_id];
  
        /* Features must not change.
 -       * Not an artifical restriction anymore, as we must prevent
 +       * Not an artificial restriction anymore, as we must prevent
         * possible loops created by swapping in setlist type of sets. */
        if (!(from->type->features == to->type->features &&
              from->type->family == to->type->family))
@@@ -1022,8 -1022,9 +1022,9 @@@ ip_set_dump_start(struct sk_buff *skb, 
        if (cb->args[1] >= ip_set_max)
                goto out;
  
-       pr_debug("args[0]: %ld args[1]: %ld\n", cb->args[0], cb->args[1]);
        max = cb->args[0] == DUMP_ONE ? cb->args[1] + 1 : ip_set_max;
+ dump_last:
+       pr_debug("args[0]: %ld args[1]: %ld\n", cb->args[0], cb->args[1]);
        for (; cb->args[1] < max; cb->args[1]++) {
                index = (ip_set_id_t) cb->args[1];
                set = ip_set_list[index];
                 * so that lists (unions of sets) are dumped last.
                 */
                if (cb->args[0] != DUMP_ONE &&
-                   !((cb->args[0] == DUMP_ALL) ^
-                     (set->type->features & IPSET_DUMP_LAST)))
+                   ((cb->args[0] == DUMP_ALL) ==
+                    !!(set->type->features & IPSET_DUMP_LAST)))
                        continue;
                pr_debug("List set: %s\n", set->name);
                if (!cb->args[2]) {
                        goto release_refcount;
                }
        }
+       /* If we dump all sets, continue with dumping last ones */
+       if (cb->args[0] == DUMP_ALL) {
+               cb->args[0] = DUMP_LAST;
+               cb->args[1] = 0;
+               goto dump_last;
+       }
        goto out;
  
  nla_put_failure:
@@@ -1093,11 -1100,6 +1100,6 @@@ release_refcount
                pr_debug("release set %s\n", ip_set_list[index]->name);
                ip_set_put_byindex(index);
        }
-       /* If we dump all sets, continue with dumping last ones */
-       if (cb->args[0] == DUMP_ALL && cb->args[1] >= max && !cb->args[2])
-               cb->args[0] = DUMP_LAST;
  out:
        if (nlh) {
                nlmsg_end(skb, nlh);