From 3b7a8a102c076eb015cf779613b06458d3d420b8 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Wed, 30 Nov 2016 23:03:46 +0100 Subject: datatype: honor -nn option from inet_service_type_print() If -nn is passed, we have to display ports in numbers, not as a symbol. Fixes: ccc5da470e76 ("datatype: Replace getnameinfo() by internal lookup table") Reported-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso --- src/datatype.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/datatype.c') diff --git a/src/datatype.c b/src/datatype.c index c92f9276..b5d73bc0 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); } -- cgit v1.2.3