Skip to contentSkip to conversation

netlink_delinearize: fix wrong conversion to "list" in ct mark

PATCH Applied Fernando Fernandez Mancera 2 participants 2 messages Sep 9, 2019 – Sep 10, 2019 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 netlink_delinearize: fix wrong conversion to "list" in ct mark

We only prefer "list" representation in "ct event". For any other type of "ct" use the "or" representation so nft prints "ct mark set ct mark | 0x00000001" instead of "ct mark set ct mark,0x00000001".

Fixes cb8f81ac3079 ("netlink_delinearize: prefer ct event set foo,bar over 'set foo|bar'")
---
 src/netlink_delinearize.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
src/netlink_delinearize.c +2 -1
index fc2574b..f7d328a 100644
@@ -2550,7 +2550,8 @@ static void rule_parse_postprocess(struct netlink_parse_ctx *ctx, struct rule *r
 			if (stmt->ct.expr != NULL) {
 				expr_postprocess(&rctx, &stmt->ct.expr);
 
-				if (stmt->ct.expr->etype == EXPR_BINOP)
+				if (stmt->ct.expr->etype == EXPR_BINOP &&
+				    stmt->ct.key == NFT_CT_EVENTMASK)
 					stmt->ct.expr = binop_tree_to_list(NULL,
 									   stmt->ct.expr);
 			}
Signature · 1 line
2.20.1
maintainer Applied
#1 lore raw
Quoted 3 lines · Fernando Fernandez Mancera

We only prefer "list" representation in "ct event". For any other type of "ct" use the "or" representation so nft prints "ct mark set ct mark | 0x00000001" instead of "ct mark set ct mark,0x00000001".

Applied, thanks Fernando.