netfilter: ipset: bitmap:ip,mac: fix listing with timeout
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Sat, 13 Apr 2013 12:30:54 +0000 (14:30 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 18 Apr 2013 21:40:41 +0000 (23:40 +0200)
The type when timeout support was enabled, could not list all elements,
just the first ones which could fit into one netlink message: it just
did not continue listing after the first message.

Reported-by: Yoann JUET <yoann.juet@univ-nantes.fr>
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Tested-by: Yoann JUET <yoann.juet@univ-nantes.fr>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/ipset/ip_set_bitmap_ipmac.c

index 0f92dc24cb894bfa0674c2b3f6dca970d7615c64..d7df6ac2c6f10a1bf14be997a981f577e5364b98 100644 (file)
@@ -339,7 +339,11 @@ bitmap_ipmac_tlist(const struct ip_set *set,
 nla_put_failure:
        nla_nest_cancel(skb, nested);
        ipset_nest_end(skb, atd);
-       return -EMSGSIZE;
+       if (unlikely(id == first)) {
+               cb->args[2] = 0;
+               return -EMSGSIZE;
+       }
+       return 0;
 }
 
 static int