From 49aa44ba9e09e5f62f3dccbe14b845e20cfc7b20 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Sat, 18 Dec 2021 21:14:15 +0100 Subject: nft-shared: set correct register value 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 --- iptables/nft-shared.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'iptables/nft-shared.c') diff --git a/iptables/nft-shared.c b/iptables/nft-shared.c index b281ba29..4394e8b7 100644 --- a/iptables/nft-shared.c +++ b/iptables/nft-shared.c @@ -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); -- cgit v1.2.3