]> granicus.if.org Git - ipset/commitdiff
Make sure ip_set_max isn't set to IPSET_INVALID_ID
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Tue, 27 Nov 2012 16:10:33 +0000 (17:10 +0100)
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Tue, 27 Nov 2012 16:11:45 +0000 (17:11 +0100)
kernel/net/netfilter/ipset/ip_set_core.c

index bd87ef862774e1c6b3523e18c3209f1cef8879c6..962f1242f2e068cb578039697a03a36515a5b48d 100644 (file)
@@ -811,7 +811,7 @@ ip_set_create(struct sock *ctnl, struct sk_buff *skb,
                struct ip_set **list, **tmp;
                ip_set_id_t i = ip_set_max + IP_SET_INC;
 
-               if (i < ip_set_max)
+               if (i < ip_set_max || i == IPSET_INVALID_ID)
                        /* Wraparound */
                        goto cleanup;