[PATCH nft 2/2] 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.

Fixes: baa4e0e3fa5f ("src: add NFT_CTX_OUTPUT_NUMERIC_PROTO")
Reported-by: Phil Sutter <phil@xxxxxx>
Signed-off-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
---
v2: rebase upon ("src: get rid of nft_ctx_output_{get,set}_numeric()")

 src/expression.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/expression.c b/src/expression.c
index af78c39806b2..6298d5a7bdc8 100644
--- a/src/expression.c
+++ b/src/expression.c
@@ -662,7 +662,7 @@ 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_SERVICE | NFT_CTX_OUTPUT_REVERSEDNS);
 	octx->flags |= NFT_CTX_OUTPUT_NUMERIC_SYMBOL;
 	expr_print(expr->left, octx);
 	nft_print(octx, "-");
-- 
2.11.0




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

  Powered by Linux