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

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