]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
segtree: don't check for overlaps if set definition is empty
authorPablo Neira Ayuso <pablo@netfilter.org>
Tue, 21 Jun 2016 15:32:52 +0000 (17:32 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 22 Jun 2016 16:39:38 +0000 (18:39 +0200)
If the set comes without definition (ie. no elements) then skip check
for overlaps since set->init is NULL.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/segtree.c

index 74f0fb33c2e1a8cd3c89365a3308e28591aa512a..fa11967adbd25041645a8445977d6df767ff5413 100644 (file)
@@ -377,7 +377,7 @@ static int set_to_segtree(struct list_head *msgs, struct set *set,
        /* We are updating an existing set with new elements, check if the new
         * interval overlaps with any of the existing ones.
         */
-       if (add && set->init != init) {
+       if (add && set->init && set->init != init) {
                err = set_overlap(msgs, set, init, tree->keylen);
                if (err < 0)
                        return err;