]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
sets: fix sets using intervals
authorPatrick McHardy <kaber@trash.net>
Sun, 9 Dec 2012 12:35:23 +0000 (13:35 +0100)
committerPatrick McHardy <kaber@trash.net>
Sun, 9 Dec 2012 13:55:32 +0000 (14:55 +0100)
When using intervals, the initializers set_flags are set to SET_F_INTERVAL,
however that is not propagated back to the set, so the segtree construction
is not performed.

Signed-off-by: Patrick McHardy <kaber@trash.net>
src/evaluate.c

index a2cc8e4576d07ad6b21e9449b1721a2bea16c054..9e49e911a2e0ad34c0d02699e391875a63c21e55 100644 (file)
@@ -679,6 +679,8 @@ static int expr_evaluate_map(struct eval_ctx *ctx, struct expr **expr)
                if (expr_evaluate(ctx, &map->mappings->set->init) < 0)
                        return -1;
                ctx->set = NULL;
+
+               map->mappings->set->flags |= map->mappings->set->init->set_flags;
                break;
        case EXPR_SYMBOL:
                if (expr_evaluate(ctx, &map->mappings) < 0)
@@ -696,7 +698,7 @@ static int expr_evaluate_map(struct eval_ctx *ctx, struct expr **expr)
        map->flags |= EXPR_F_CONSTANT;
 
        /* Data for range lookups needs to be in big endian order */
-       if (map->mappings->set_flags & SET_F_INTERVAL &&
+       if (map->mappings->set->flags & SET_F_INTERVAL &&
            byteorder_conversion(ctx, &map->map, BYTEORDER_BIG_ENDIAN) < 0)
                return -1;