netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH nft] datatype: honor -nn option from inet_service_type_print()
@ 2016-11-30 22:06 Pablo Neira Ayuso
  0 siblings, 0 replies; only message in thread
From: Pablo Neira Ayuso @ 2016-11-30 22:06 UTC (permalink / raw)
  To: netfilter-devel

If -nn is passed, we have to display ports in numbers, not as a symbol.

Reported-by: Florian Westphal <fw@strlen.de>
Fixes: ccc5da470e76 ("datatype: Replace getnameinfo() by internal lookup table")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 src/datatype.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/datatype.c b/src/datatype.c
index c92f9276f838..b5d73bc045e2 100644
--- a/src/datatype.c
+++ b/src/datatype.c
@@ -559,6 +559,10 @@ const struct datatype inet_protocol_type = {
 
 static void inet_service_type_print(const struct expr *expr)
 {
+	if (numeric_output >= NUMERIC_PORT) {
+		integer_type_print(expr);
+		return;
+	}
 	symbolic_constant_print(&inet_service_tbl, expr, false);
 }
 
-- 
2.1.4


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-11-30 22:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-30 22:06 [PATCH nft] datatype: honor -nn option from inet_service_type_print() Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).