Signed-off-by: liweigang <liweiganga@uniontech.com> (cherry picked from commit 8a840a74a9950d164bf238373dd8ce7863178982)
43 lines
1.1 KiB
Diff
43 lines
1.1 KiB
Diff
From 2b24dd29c5fa1c7e4cf44f0753752d25106273a0 Mon Sep 17 00:00:00 2001
|
|
From: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
Date: Tue, 13 Feb 2024 17:09:20 +0100
|
|
Subject: [PATCH] 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")
|
|
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
---
|
|
src/expression.c | 4 +++-
|
|
1 file changed, 3 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/src/expression.c b/src/expression.c
|
|
index dde48b6a..cb2573fe 100644
|
|
--- a/src/expression.c
|
|
+++ b/src/expression.c
|
|
@@ -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) {
|
|
--
|
|
2.43.4
|
|
|