Nmap Development mailing list archives

Re: [Exp PATCH] Bail out of Traceroute::trace() with no valid targets


From: "Eddie Bell" <ejlbell () gmail com>
Date: Mon, 19 Mar 2007 17:57:36 +0000

Great stuff, Thanks for testing it Kris. It is easy to miss these
things when you are so involved in the code.

- eddie

On 19/03/07, Kris Katterjohn <katterjohn () gmail com> wrote:
The attached patch (/nmap-exp/kris SVN r4590) bails out of
Traceroute::trace() if no valid targets are given.

Here's the SVN log:

------------------------------------------------------------------------
r4590 | kris | 2007-03-19 11:47:57 -0500 (Mon, 19 Mar 2007) | 1 line

Bail out of Traceroute::trace() if no valid targets are available.
Before, it would essentially just run through the rest of the function
without doing much of anything.  So if we were trying to traceroute a
machine that's directly connected, the "Initiating"/"Completed" messages
would still appear even though no tracing would be done.
------------------------------------------------------------------------

I wasn't sure if this (the printing of the "Initiating"/"Completed"
lines) was desirable or not.  No TRACEROUTE table is printed if there
are no valid targets, and no actual tracing is done, so I didn't think
these should be printed.  Plus, there's no need to go through the rest
of the function if there aren't any valid targets, anyway.

Lemme know what you think :)


Thanks,
Kris Katterjohn

Index: traceroute.cc
===================================================================
--- traceroute.cc       (revision 4589)
+++ traceroute.cc       (revision 4590)
@@ -814,6 +814,9 @@
      * legitimate to trace to */
     sendTTLProbes (Targets, valid_targets);

+    if (!valid_targets.size())
+        return;
+
     SPM = new ScanProgressMeter ("Traceroute");

     while (!readTraceResponses ()) {




_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org


Current thread: