nft-shared: set correc register value
Florian Westphal
maintainerPATCH 1/1 nft-shared: set correc register value
reg is populated based off the payload base:
NFTNL_EXPR_META_KEY = NFTNL_EXPR_BASE,NFTNL_EXPR_META_DREG,NFTNL_EXPR_PAYLOAD_DREG = NFTNL_EXPR_BASE,
Fix this. It worked because the simple nft rules currently generated via ipables-nft have base == register-number but this is a coincidence.
Signed-off-by Florian Westphal <[email protected]>
--- iptables/nft-shared.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
iptables/nft-shared.c +1 -1
@@ -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 );
Signature · 1 line
2.33.1
Pablo Neira Ayuso
maintainerQuoted 9 lines · Florian Westphal
reg is populated based off the payload base:
NFTNL_EXPR_META_KEY=NFTNL_EXPR_BASE,NFTNL_EXPR_META_DREG,NFTNL_EXPR_PAYLOAD_DREG=NFTNL_EXPR_BASE,Fix this. It worked because the simple nft rules currently generated via ipables-nft have base == register-number but this is a coincidence.
s/correc/correct/
other than that, LGTM, thanks