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

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