Skip to contentSkip to conversation

datatype: honor -nn option from inet_service_type_print()

PATCH New Pablo Neira Ayuso 1 participant 1 message Nov 30, 2016 netfilter

lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 1/1 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")
---
 src/datatype.c | 4 ++++
 1 file changed, 4 insertions(+)
src/datatype.c +4 -0
index c92f9276f838..b5d73bc045e2 100644
@@ -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);
 }
 
Signature · 1 line
2.1.4