Index: traceroute.h =================================================================== --- traceroute.h (revision 14654) +++ traceroute.h (working copy) @@ -111,6 +111,10 @@ #define G_TTL(x) (x == G_ALIVE_TTL || x == G_DEAD_TTL) #define MAX_TTL 50 +/* If the distance to the target is not known (it's not responsive to the probe + we're using), the maximum number of consecutive timeouts we'll tolerate + before giving up. */ +#define UNKNOWN_DIST_MAX_TIMEOUTS 3 #define HOP_COL 0 #define RTT_COL 1 Index: traceroute.cc =================================================================== --- traceroute.cc (revision 14654) +++ traceroute.cc (working copy) @@ -1146,8 +1146,15 @@ noDistProbe = true; if (o.verbose) log_write (LOG_STDOUT, "%s: no reply to our hop distance probe!\n", IPStr ()); - } else if (it->second->ttl > MAX_TTL) { - setState(G_DEAD_TTL); + } else { + /* We are done if + 1. We don't know the distance to the host and have gotten a + number of consecutive timeouts, or + 2. We've reached the maximum TTL limit. */ + if (noDistProbe && consecTimeouts >= UNKNOWN_DIST_MAX_TIMEOUTS) + setState(G_FINISH); + else if (it->second->ttl > MAX_TTL) + setState(G_DEAD_TTL); } } else { droppedPackets++;