]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
nft-shared: set correct register value
authorFlorian Westphal <fw@strlen.de>
Sat, 18 Dec 2021 20:14:15 +0000 (21:14 +0100)
committerFlorian Westphal <fw@strlen.de>
Thu, 23 Dec 2021 13:39:43 +0000 (14:39 +0100)
NFTNL_EXPR_META_DREG equals NFTNL_EXPR_PAYLOAD_BASE, so we set
dreg to the payload base instead.

It "works" because the simple nft rules currently generated via
ipables-nft have base == register-number but this is a
coincidence.

Signed-off-by: Florian Westphal <fw@strlen.de>
iptables/nft-shared.c

index b281ba2987cc39c78c692d5c31da425e61493601..4394e8b7c4e8d208c03bed432d5fdb90a1d1ef50 100644 (file)
@@ -443,7 +443,7 @@ static void nft_parse_payload(struct nft_xt_ctx *ctx, struct nftnl_expr *e)
                ctx->flags |= NFT_XT_CTX_PREV_PAYLOAD;
        }
 
-       ctx->reg = nftnl_expr_get_u32(e, NFTNL_EXPR_META_DREG);
+       ctx->reg = nftnl_expr_get_u32(e, NFTNL_EXPR_PAYLOAD_DREG);
        ctx->payload.base = nftnl_expr_get_u32(e, NFTNL_EXPR_PAYLOAD_BASE);
        ctx->payload.offset = nftnl_expr_get_u32(e, NFTNL_EXPR_PAYLOAD_OFFSET);
        ctx->payload.len = nftnl_expr_get_u32(e, NFTNL_EXPR_PAYLOAD_LEN);