tcpdump mailing list archives

[PATCH 3/3] Convert port numbers to service names unless -nn is used.


From: Miroslav Lichvar <mlichvar () redhat com>
Date: Thu, 13 Aug 2009 17:44:25 +0200

---
 addrtoname.c |    4 ++--
 tcpdump.1.in |    6 +++++-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/addrtoname.c b/addrtoname.c
index 593840c..59ee47a 100644
--- a/addrtoname.c
+++ b/addrtoname.c
@@ -736,7 +736,7 @@ init_servarray(void)
 
                while (table->name)
                        table = table->nxt;
-               if (nflag) {
+               if (nflag > 1) {
                        (void)snprintf(buf, sizeof(buf), "%d", port);
                        table->name = strdup(buf);
                } else
@@ -1136,7 +1136,7 @@ init_addrtoname(u_int32_t localnet, u_int32_t mask)
                f_localnet = localnet;
                f_netmask = mask;
        }
-       if (nflag)
+       if (nflag > 1)
                /*
                 * Simplest way to suppress names.
                 */
diff --git a/tcpdump.1.in b/tcpdump.1.in
index 86174c2..c1dad64 100644
--- a/tcpdump.1.in
+++ b/tcpdump.1.in
@@ -394,7 +394,11 @@ Use \fIsecret\fP as a shared secret for validating the digests found in
 TCP segments with the TCP-MD5 option (RFC 2385), if present.
 .TP
 .B \-n
-Don't convert addresses (i.e., host addresses, port numbers, etc.) to names.
+Don't convert host addresses to names.  This can be used to avoid 
+DNS lookups.
+.TP
+.B \-nn
+Don't convert protocol and port numbers etc. to names either.  
 .TP
 .B \-N
 Don't print domain name qualification of host names.
-- 
1.6.2.5

-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: