Netfilter-Devel Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH nft] netlink_delinearize: fix wrong conversion to "list" in ct mark
@ 2019-09-09 19:52 Fernando Fernandez Mancera
  2019-09-10 20:01 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: Fernando Fernandez Mancera @ 2019-09-09 19:52 UTC (permalink / raw)
  To: netfilter-devel; +Cc: 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".

Link: https://bugzilla.netfilter.org/show_bug.cgi?id=1364
Fixes: cb8f81ac3079 ("netlink_delinearize: prefer ct event set foo,bar over 'set foo|bar'")
Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
---
 src/netlink_delinearize.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/netlink_delinearize.c b/src/netlink_delinearize.c
index fc2574b..f7d328a 100644
--- a/src/netlink_delinearize.c
+++ b/src/netlink_delinearize.c
@@ -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);
 			}
-- 
2.20.1


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

* Re: [PATCH nft] netlink_delinearize: fix wrong conversion to "list" in ct mark
  2019-09-09 19:52 [PATCH nft] netlink_delinearize: fix wrong conversion to "list" in ct mark Fernando Fernandez Mancera
@ 2019-09-10 20:01 ` Pablo Neira Ayuso
  0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2019-09-10 20:01 UTC (permalink / raw)
  To: Fernando Fernandez Mancera; +Cc: netfilter-devel

On Mon, Sep 09, 2019 at 09:52:47PM +0200, Fernando Fernandez Mancera wrote:
> 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.

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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-09 19:52 [PATCH nft] netlink_delinearize: fix wrong conversion to "list" in ct mark Fernando Fernandez Mancera
2019-09-10 20:01 ` Pablo Neira Ayuso

Netfilter-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/netfilter-devel/0 netfilter-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 netfilter-devel netfilter-devel/ https://lore.kernel.org/netfilter-devel \
		netfilter-devel@vger.kernel.org netfilter-devel@archiver.kernel.org
	public-inbox-index netfilter-devel


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.netfilter-devel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox