diff options
author | Elise Lennion <elise.lennion@gmail.com> | 2017-02-02 10:31:56 -0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2017-02-05 21:39:48 +0100 |
commit | 85b1e3c0052ef69b3ab449b692b787037c0b8bdb (patch) | |
tree | 9dae94fd220d2c2590a4f051fee492b3c803adb0 /src/datatype.c | |
parent | 9b7b2b64caff9de47de36a050cae9f3fbf58e433 (diff) |
src: Always print range expressions numerically
Because the rules are more legible this way. Also, the parser doesn't
accept strings on ranges, so, printing ranges numerically better match
the rules definition.
Fixes(Bug 1046 - mobility header with range gives illegible rule).
Signed-off-by: Elise Lennion <elise.lennion@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/datatype.c')
-rw-r--r-- | src/datatype.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/datatype.c b/src/datatype.c index 1518606a..d697a075 100644 --- a/src/datatype.c +++ b/src/datatype.c @@ -175,9 +175,15 @@ void symbolic_constant_print(const struct symbol_table *tbl, return expr_basetype(expr)->print(expr); if (quotes) - printf("\"%s\"", s->identifier); + printf("\""); + + if (numeric_output > NUMERIC_ALL) + printf("%lu", val); else printf("%s", s->identifier); + + if (quotes) + printf("\""); } static void switch_byteorder(void *data, unsigned int len) |