summaryrefslogtreecommitdiffstats
path: root/src/netlink_linearize.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2014-01-10 13:47:57 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2014-01-10 18:37:18 +0100
commit676b0499528a64061075034065c346ad9498cafd (patch)
tree9b25cec2f7ae5497f59444b668c013fa55ea6e47 /src/netlink_linearize.c
parent4097ad726fce2398b42795d7b316d39fb8ea6ee5 (diff)
netlink: fix wrong type in attributes
Fix inconsistent attribute types in meta and cmp expressions, use uint32_t. This problem was added when converting nft to use libmnl and libnftables. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/netlink_linearize.c')
-rw-r--r--src/netlink_linearize.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/netlink_linearize.c b/src/netlink_linearize.c
index e64e92a8..79cb6a70 100644
--- a/src/netlink_linearize.c
+++ b/src/netlink_linearize.c
@@ -210,9 +210,9 @@ static void netlink_gen_cmp(struct netlink_linearize_ctx *ctx,
}
nle = alloc_nft_expr("cmp");
- nft_rule_expr_set_u8(nle, NFT_EXPR_CMP_SREG, sreg);
- nft_rule_expr_set_u8(nle, NFT_EXPR_CMP_OP,
- netlink_gen_cmp_op(expr->op));
+ nft_rule_expr_set_u32(nle, NFT_EXPR_CMP_SREG, sreg);
+ nft_rule_expr_set_u32(nle, NFT_EXPR_CMP_OP,
+ netlink_gen_cmp_op(expr->op));
netlink_gen_data(right, &nld);
nft_rule_expr_set(nle, NFT_EXPR_CMP_DATA, nld.value, nld.len);
release_register(ctx);
@@ -235,7 +235,7 @@ static void netlink_gen_range(struct netlink_linearize_ctx *ctx,
netlink_gen_expr(ctx, expr->left, sreg);
nle = alloc_nft_expr("cmp");
- nft_rule_expr_set_u8(nle, NFT_EXPR_CMP_SREG, sreg);
+ nft_rule_expr_set_u32(nle, NFT_EXPR_CMP_SREG, sreg);
nft_rule_expr_set_u32(nle, NFT_EXPR_CMP_OP,
netlink_gen_cmp_op(OP_GTE));
netlink_gen_data(range->left, &nld);
@@ -243,7 +243,7 @@ static void netlink_gen_range(struct netlink_linearize_ctx *ctx,
nft_rule_add_expr(ctx->nlr, nle);
nle = alloc_nft_expr("cmp");
- nft_rule_expr_set_u8(nle, NFT_EXPR_CMP_SREG, sreg);
+ nft_rule_expr_set_u32(nle, NFT_EXPR_CMP_SREG, sreg);
nft_rule_expr_set_u32(nle, NFT_EXPR_CMP_OP,
netlink_gen_cmp_op(OP_LTE));
netlink_gen_data(range->right, &nld);
@@ -283,8 +283,8 @@ static void netlink_gen_flagcmp(struct netlink_linearize_ctx *ctx,
nle = alloc_nft_expr("cmp");
netlink_gen_raw_data(zero, expr->right->byteorder, len, &nld);
- nft_rule_expr_set_u8(nle, NFT_EXPR_CMP_SREG, sreg);
- nft_rule_expr_set_u8(nle, NFT_EXPR_CMP_OP, NFT_CMP_NEQ);
+ nft_rule_expr_set_u32(nle, NFT_EXPR_CMP_SREG, sreg);
+ nft_rule_expr_set_u32(nle, NFT_EXPR_CMP_OP, NFT_CMP_NEQ);
netlink_gen_data(expr->right, &nld);
nft_rule_expr_set(nle, NFT_EXPR_CMP_DATA, nld.value, nld.len);
nft_rule_add_expr(ctx->nlr, nle);