Skip to contentSkip to conversation

expr: match: fix wrong flag setting in nft_rule_expr_match_parse

PATCH New Pablo Neira Ayuso 1 participant 1 message Nov 15, 2013 netfilter

lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 1/1 expr: match: fix wrong flag setting in nft_rule_expr_match_parse

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.

---
 src/expr/match.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
src/expr/match.c +3 -3
index 5d02ee7..c7863b8 100644
@@ -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;
Signature · 1 line
1.7.10.4