netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH nft 1/4] optimize: incorrect comparison for reject statement
@ 2025-03-26 20:23 Pablo Neira Ayuso
  2025-03-26 20:23 ` [PATCH nft 2/4] optimize: compact bitmask matching in set/map Pablo Neira Ayuso
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Pablo Neira Ayuso @ 2025-03-26 20:23 UTC (permalink / raw)
  To: netfilter-devel

Logic is reverse, this should returns false if the compared reject
expressions are not the same.

Fixes: 38d48fe57fff ("optimize: fix reject statement")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 src/optimize.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/optimize.c b/src/optimize.c
index 05d8084b2a47..bb849267d8d9 100644
--- a/src/optimize.c
+++ b/src/optimize.c
@@ -235,7 +235,7 @@ static bool __stmt_type_eq(const struct stmt *stmt_a, const struct stmt *stmt_b,
 		if (!stmt_a->reject.expr)
 			return true;
 
-		if (__expr_cmp(stmt_a->reject.expr, stmt_b->reject.expr))
+		if (!__expr_cmp(stmt_a->reject.expr, stmt_b->reject.expr))
 			return false;
 		break;
 	case STMT_NAT:
-- 
2.30.2


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

end of thread, other threads:[~2025-03-26 21:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-26 20:23 [PATCH nft 1/4] optimize: incorrect comparison for reject statement Pablo Neira Ayuso
2025-03-26 20:23 ` [PATCH nft 2/4] optimize: compact bitmask matching in set/map Pablo Neira Ayuso
2025-03-26 20:23 ` [PATCH nft 3/4] src: transform flag match expression to binop expression from parser Pablo Neira Ayuso
2025-03-26 20:23 ` [PATCH nft 4/4] src: remove flagcmp expression Pablo Neira Ayuso
2025-03-26 20:33   ` Florian Westphal
2025-03-26 21:06     ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).