Skip to contentSkip to conversation

expression: missing line in describe command with invalid expression

PATCH New Pablo Neira Ayuso 1 participant 1 message Feb 13, 2024 netfilter

lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 1/1 expression: missing line in describe command with invalid expression

Before:

 duh@testbed:~# nft describe blah
 symbol expression, datatype invalid (invalid)duh@testbed:#

After:

 duh@testbed:~# nft describe blah
 symbol expression, datatype invalid (invalid)
 duh@testbed:#
Fixes 48aca2de80a7 ("iptopt: fix crash with invalid field/type combo")
---
 src/expression.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
src/expression.c +3 -1
index dde48b6aa002..cb2573fec457 100644
@@ -140,8 +140,10 @@ void expr_describe(const struct expr *expr, struct output_ctx *octx)
 		nft_print(octx, "%s expression, datatype %s (%s)",
 			  expr_name(expr), dtype->name, dtype->desc);
 
-		if (dtype == &invalid_type)
+		if (dtype == &invalid_type) {
+			nft_print(octx, "\n");
 			return;
+		}
 	}
 
 	if (dtype->basetype != NULL) {
Signature · 1 line
2.30.2