summaryrefslogtreecommitdiffstats
path: root/src/expression.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2018-10-29 21:50:49 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2018-10-30 10:30:00 +0100
commit18a3c1d5bbc0082a0cbbc1f8fb7873e793069e76 (patch)
tree01f02a39c32ce591f3b62037986554e3c1a3d9f0 /src/expression.c
parent6bc50bb3ff693d73b71b82f3a3f4eb335db9aef9 (diff)
expression: always print range expression numerically
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@nwl.cc> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/expression.c')
-rw-r--r--src/expression.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/expression.c b/src/expression.c
index 5ff469c5..62a6f890 100644
--- a/src/expression.c
+++ b/src/expression.c
@@ -662,8 +662,10 @@ 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 |
+ NFT_CTX_OUTPUT_GUID);
+ octx->flags |= NFT_CTX_OUTPUT_NUMERIC_ALL;
expr_print(expr->left, octx);
nft_print(octx, "-");
expr_print(expr->right, octx);