All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] src: expr: target: fixed error in nft_rule_expr_target_parse
@ 2013-11-19 17:54 Ana Rey
  2013-11-19 20:12 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: Ana Rey @ 2013-11-19 17:54 UTC (permalink / raw)
  To: netfilter-devel

If I run my automatic unit test of libnftable, It shows:

ERROR: Expr NFT_EXPR_TG_INFO size mismatches size a: 32 b: 36

The problem was in nft_rule_expr_target_parse function.

With the attached patch, we use "mnl_attr_get_payload_len" in instead of
"mnl_attr_get_len".
---
 src/expr/target.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/expr/target.c b/src/expr/target.c
index 20bf2af..23dff3a 100644
--- a/src/expr/target.c
+++ b/src/expr/target.c
@@ -149,7 +149,7 @@ static int nft_rule_expr_target_parse(struct nft_rule_expr *e, struct nlattr *at
 	}
 
 	if (tb[NFTA_TARGET_INFO]) {
-		uint32_t len = mnl_attr_get_len(tb[NFTA_TARGET_INFO]);
+		uint32_t len = mnl_attr_get_payload_len(tb[NFTA_TARGET_INFO]);
 		void *target_data;
 
 		if (target->data)
-- 
1.8.4.rc3


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

* Re: [PATCH] src: expr: target: fixed error in nft_rule_expr_target_parse
  2013-11-19 17:54 [PATCH] src: expr: target: fixed error in nft_rule_expr_target_parse Ana Rey
@ 2013-11-19 20:12 ` Pablo Neira Ayuso
  0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2013-11-19 20:12 UTC (permalink / raw)
  To: Ana Rey; +Cc: netfilter-devel

On Tue, Nov 19, 2013 at 06:54:14PM +0100, Ana Rey wrote:
> If I run my automatic unit test of libnftable, It shows:
> 
> ERROR: Expr NFT_EXPR_TG_INFO size mismatches size a: 32 b: 36
> 
> The problem was in nft_rule_expr_target_parse function.
> 
> With the attached patch, we use "mnl_attr_get_payload_len" in instead of
> "mnl_attr_get_len".

Good catches, thanks for these fixes Ana.

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

end of thread, other threads:[~2013-11-19 20:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-19 17:54 [PATCH] src: expr: target: fixed error in nft_rule_expr_target_parse Ana Rey
2013-11-19 20:12 ` Pablo Neira Ayuso

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.