]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
netlink: fix binop RHS byteorder
authorPatrick McHardy <kaber@trash.net>
Tue, 28 Jul 2009 12:17:42 +0000 (14:17 +0200)
committerPatrick McHardy <kaber@trash.net>
Tue, 28 Jul 2009 12:17:42 +0000 (14:17 +0200)
The byteorder of the RHS of a binop must be set before post-processing it to
make sure it will get byteorder-switched if necessary.

Fixes invalid conntrack expression states when used with bitmasks:

 ct state 33554432,67108864 counter packets 1924 bytes 142960

 =>

 ct state established,related counter packets 2029 bytes 151508

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

index 66690255f9465cc8e5a852d989edd8e44ffe2810..e71c129d282b87546d812943137e3761478d8c83 100644 (file)
@@ -550,9 +550,10 @@ static void expr_postprocess(struct rule_pp_ctx *ctx,
                break;
        case EXPR_BINOP:
                expr_postprocess(ctx, stmt, &expr->left);
-               expr_postprocess(ctx, stmt, &expr->right);
                expr_set_type(expr->right, expr->left->dtype,
                              expr->left->byteorder);
+               expr_postprocess(ctx, stmt, &expr->right);
+
                expr_set_type(expr, expr->left->dtype,
                              expr->left->byteorder);
                break;