netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH nft] netlink: meta: fix wrong type in attributes
@ 2014-02-17 15:48 Florian Westphal
  2014-02-17 17:25 ` Patrick McHardy
  0 siblings, 1 reply; 8+ messages in thread
From: Florian Westphal @ 2014-02-17 15:48 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Florian Westphal

We segfault on 'list filter' when meta expr is used as _u8
returns invalid register 0.

Signed-off-by: Florian Westphal <fw@strlen.de>
---
 src/netlink_delinearize.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/netlink_delinearize.c b/src/netlink_delinearize.c
index 6668308..b976d86 100644
--- a/src/netlink_delinearize.c
+++ b/src/netlink_delinearize.c
@@ -346,9 +346,9 @@ static void netlink_parse_meta_sreg(struct netlink_parse_ctx *ctx,
 	struct expr *expr;
 
 	expr = netlink_get_register(ctx, loc,
-			nft_rule_expr_get_u8(nle, NFT_EXPR_META_SREG));
+			nft_rule_expr_get_u32(nle, NFT_EXPR_META_SREG));
 	stmt = meta_stmt_alloc(loc,
-			       nft_rule_expr_get_u8(nle, NFT_EXPR_META_KEY),
+			       nft_rule_expr_get_u32(nle, NFT_EXPR_META_KEY),
 			       expr);
 	expr_set_type(expr, stmt->meta.tmpl->dtype, stmt->meta.tmpl->byteorder);
 
-- 
1.8.1.5


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-02-18 10:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-17 15:48 [PATCH nft] netlink: meta: fix wrong type in attributes Florian Westphal
2014-02-17 17:25 ` Patrick McHardy
2014-02-17 19:14   ` Pablo Neira Ayuso
2014-02-17 19:40     ` Patrick McHardy
2014-02-17 21:03   ` Florian Westphal
2014-02-17 22:49     ` Pablo Neira Ayuso
2014-02-18  1:27     ` Patrick McHardy
2014-02-18 10:02       ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).