From: Phil Sutter Date: Mon, 10 Sep 2018 14:18:10 +0000 (+0200) Subject: src: Fix literal check for inet_service type X-Git-Tag: v0.9.1~272 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=35ea9534d425d762692fa7dbbe9ecbb34a27e216;p=thirdparty%2Fnftables.git src: Fix literal check for inet_service type Since literal option is supposed to be a level, matching for equality is not correct here since the level may be higher than NFT_LITERAL_PORT. This fixes for ports being printed numerically if '-l' option was given twice. Fixes: b0f6a45b25dd1 ("src: add --literal option") Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso --- diff --git a/src/datatype.c b/src/datatype.c index bc3df214..50af3df0 100644 --- a/src/datatype.c +++ b/src/datatype.c @@ -648,7 +648,7 @@ static void inet_service_print(const struct expr *expr, struct output_ctx *octx) void inet_service_type_print(const struct expr *expr, struct output_ctx *octx) { - if (octx->literal == NFT_LITERAL_PORT) { + if (octx->literal >= NFT_LITERAL_PORT) { inet_service_print(expr, octx); return; }