diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2022-04-21 16:53:33 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2022-05-02 13:16:28 +0200 |
commit | 4c70c42fe8d937a2ca2709daa9efe96275d194da (patch) | |
tree | cbe03dc6b22110a43d6697effb1065df2ba2e2f8 | |
parent | 18c96821b5901ac5c66dcbc5f299bd07ef5569ef (diff) |
nft-shared: update context register for bitwise expression
Update the destination register, otherwise nft_parse_cmp() gives up on
interpreting the cmp expression when bitwise sreg != dreg.
Fixes: 2c4a34c30cb4 ("iptables-compat: fix address prefix")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r-- | iptables/nft-shared.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/iptables/nft-shared.c b/iptables/nft-shared.c index c5721854..b3993211 100644 --- a/iptables/nft-shared.c +++ b/iptables/nft-shared.c @@ -460,6 +460,8 @@ static void nft_parse_bitwise(struct nft_xt_ctx *ctx, struct nftnl_expr *e) if (ctx->reg && reg != ctx->reg) return; + reg = nftnl_expr_get_u32(e, NFTNL_EXPR_BITWISE_DREG); + ctx->reg = reg; data = nftnl_expr_get(e, NFTNL_EXPR_BITWISE_XOR, &len); memcpy(ctx->bitwise.xor, data, len); data = nftnl_expr_get(e, NFTNL_EXPR_BITWISE_MASK, &len); |