[PATCH nft] datatype: honor -nn option from inet_service_type_print()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Reported-by: Florian Westphal <fw@xxxxxxxxx>
Fixes: ccc5da470e76 ("datatype: Replace getnameinfo() by internal lookup table")
Signed-off-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux