[nft,4/4] netlink: fix linearize numgen type
diff mbox

Message ID 901d89195567977f237e66ba75e4c7003e72164e.1477170966.git.nevola@gmail.com
State Accepted
Delegated to: Pablo Neira
Headers show

Commit Message

Laura Garcia Oct. 22, 2016, 9:36 p.m. UTC
Avoid to treat numgen type attribute as a register.

Fixes: 345236211715 ("src: add hash expression")

Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
---
 src/netlink_linearize.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Pablo Neira Ayuso Oct. 27, 2016, 4:58 p.m. UTC | #1
On Sat, Oct 22, 2016 at 11:36:47PM +0200, Laura Garcia Liebana wrote:
> Avoid to treat numgen type attribute as a register.

Also applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch
diff mbox

diff --git a/src/netlink_linearize.c b/src/netlink_linearize.c
index 15a8953..66552ac 100644
--- a/src/netlink_linearize.c
+++ b/src/netlink_linearize.c
@@ -181,7 +181,7 @@  static void netlink_gen_numgen(struct netlink_linearize_ctx *ctx,
 
 	nle = alloc_nft_expr("numgen");
 	netlink_put_register(nle, NFTNL_EXPR_NG_DREG, dreg);
-	netlink_put_register(nle, NFTNL_EXPR_NG_TYPE, expr->numgen.type);
+	nftnl_expr_set_u32(nle, NFTNL_EXPR_NG_TYPE, expr->numgen.type);
 	nftnl_expr_set_u32(nle, NFTNL_EXPR_NG_MODULUS, expr->numgen.mod);
 	nftnl_expr_set_u32(nle, NFTNL_EXPR_NG_OFFSET, expr->numgen.offset);
 	nftnl_rule_add_expr(ctx->nlr, nle);