Patchwork expr: match: fix wrong flag setting in nft_rule_expr_match_parse

login
register
mail settings
Submitter Pablo Neira
Date Nov. 15, 2013, 2:19 p.m.
Message ID <1384525185-6675-1-git-send-email-pablo@netfilter.org>
Download mbox | patch
Permalink /patch/291578/
State Accepted
Headers show

Comments

Pablo Neira - Nov. 15, 2013, 2:19 p.m.
Expression flags were incorrectly set. It should not manifest in any
bug as NFTA_MATCH_* and NFT_EXPR_MT_* are overlapping. Still incorrect
from the semantic side.

Reported-by: Ana Rey Botello <anarey@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 src/expr/match.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Patch

diff --git a/src/expr/match.c b/src/expr/match.c
index 5d02ee7..c7863b8 100644
--- a/src/expr/match.c
+++ b/src/expr/match.c
@@ -140,12 +140,12 @@  static int nft_rule_expr_match_parse(struct nft_rule_expr *e, struct nlattr *att
 			 mnl_attr_get_str(tb[NFTA_MATCH_NAME]));
 
 		match->name[XT_EXTENSION_MAXNAMELEN-1] = '\0';
-		e->flags |= (1 << NFTA_MATCH_NAME);
+		e->flags |= (1 << NFT_EXPR_MT_NAME);
 	}
 
 	if (tb[NFTA_MATCH_REV]) {
 		match->rev = ntohl(mnl_attr_get_u32(tb[NFTA_MATCH_REV]));
-		e->flags |= (1 << NFTA_MATCH_REV);
+		e->flags |= (1 << NFT_EXPR_MT_REV);
 	}
 
 	if (tb[NFTA_MATCH_INFO]) {
@@ -164,7 +164,7 @@  static int nft_rule_expr_match_parse(struct nft_rule_expr *e, struct nlattr *att
 		match->data = match_data;
 		match->data_len = len;
 
-		e->flags |= (1 << NFTA_MATCH_INFO);
+		e->flags |= (1 << NFT_EXPR_MT_INFO);
 	}
 
 	return 0;