Blame SOURCES/0007-Introduce-nn-option.patch

1f5cfb
From 9ea43c6c97d3653cb58c1934f8770b951917bf9a Mon Sep 17 00:00:00 2001
1f5cfb
From: rpm-build <rpm-build>
1f5cfb
Date: Mon, 20 Oct 2014 13:26:38 +0200
1f5cfb
Subject: [PATCH 7/8] Introduce -nn option
1f5cfb
1f5cfb
This changes the semantics on -n option so only namelookups are skipped. Port
1f5cfb
numbers *are* translated to their string representations. Option -nn then has
1f5cfb
the same semantics as -n had originally.
1f5cfb
---
1f5cfb
 addrtoname.c | 4 ++--
1f5cfb
 tcpdump.1.in | 6 +++++-
1f5cfb
 2 files changed, 7 insertions(+), 3 deletions(-)
1f5cfb
1f5cfb
diff --git a/addrtoname.c b/addrtoname.c
1f5cfb
index 949acb7..9dd78d8 100644
1f5cfb
--- a/addrtoname.c
1f5cfb
+++ b/addrtoname.c
1f5cfb
@@ -810,7 +810,7 @@ init_servarray(netdissect_options *ndo)
1f5cfb
 
1f5cfb
 		while (table->name)
1f5cfb
 			table = table->nxt;
1f5cfb
-		if (ndo->ndo_nflag) {
1f5cfb
+		if (ndo->ndo_nflag > 1) {
1f5cfb
 			(void)snprintf(buf, sizeof(buf), "%d", port);
1f5cfb
 			table->name = strdup(buf);
1f5cfb
 		} else
1f5cfb
@@ -1233,7 +1233,7 @@ init_addrtoname(netdissect_options *ndo, uint32_t localnet, uint32_t mask)
1f5cfb
 		f_localnet = localnet;
1f5cfb
 		f_netmask = mask;
1f5cfb
 	}
1f5cfb
-	if (ndo->ndo_nflag)
1f5cfb
+	if (ndo->ndo_nflag > 1)
1f5cfb
 		/*
1f5cfb
 		 * Simplest way to suppress names.
1f5cfb
 		 */
1f5cfb
diff --git a/tcpdump.1.in b/tcpdump.1.in
1f5cfb
index ca5cff2..c711a24 100644
1f5cfb
--- a/tcpdump.1.in
1f5cfb
+++ b/tcpdump.1.in
1f5cfb
@@ -547,7 +547,11 @@ Use \fIsecret\fP as a shared secret for validating the digests found in
1f5cfb
 TCP segments with the TCP-MD5 option (RFC 2385), if present.
1f5cfb
 .TP
1f5cfb
 .B \-n
1f5cfb
-Don't convert addresses (i.e., host addresses, port numbers, etc.) to names.
1f5cfb
+Don't convert host addresses to names.  This can be used to avoid
1f5cfb
+DNS lookups.
1f5cfb
+.TP
1f5cfb
+.B \-nn
1f5cfb
+Don't convert protocol and port numbers etc. to names either.
1f5cfb
 .TP
1f5cfb
 .B \-N
1f5cfb
 Don't print domain name qualification of host names.
1f5cfb
-- 
1f5cfb
2.9.3
1f5cfb