[PATCH nft] expression: always print range expression numerically

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Otherwise we end up displaying things that we cannot parse as input.
Moreover, in a range, it's relevant to the user the values that are
enclosed in the range, so let's print this numerically.

Reported-by: Phil Sutter <phil@xxxxxx>
Signed-off-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
---
Based on my recent patches, still not pushed out.

 src/expression.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/expression.c b/src/expression.c
index 5ff469c561d5..aadc4efcba82 100644
--- a/src/expression.c
+++ b/src/expression.c
@@ -662,8 +662,8 @@ static void range_expr_print(const struct expr *expr, struct output_ctx *octx)
 {
 	unsigned int flags = octx->flags;
 
-	octx->flags &= ~NFT_CTX_OUTPUT_SERVICE;
-	octx->flags |= NFT_CTX_OUTPUT_NUMERIC_PROTO;
+	octx->flags &= ~(NFT_CTX_OUTPUT_SERVICE | NFT_CTX_OUTPUT_REVERSEDNS);
+	octx->flags |= (NFT_CTX_OUTPUT_NUMERIC_PROTO | NFT_CTX_OUTPUT_NUMERIC_SYMBOL);
 	expr_print(expr->left, octx);
 	nft_print(octx, "-");
 	expr_print(expr->right, octx);
-- 
2.11.0




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux