summaryrefslogtreecommitdiff
path: root/usr.sbin/traceroute/traceroute.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/traceroute/traceroute.c')
-rw-r--r--usr.sbin/traceroute/traceroute.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/traceroute/traceroute.c b/usr.sbin/traceroute/traceroute.c
index 80bfb6f775a..5a6f0b88bc4 100644
--- a/usr.sbin/traceroute/traceroute.c
+++ b/usr.sbin/traceroute/traceroute.c
@@ -482,6 +482,7 @@ main(argc, argv)
u_long lastaddr = 0;
int got_there = 0;
int unreachable = 0;
+ int timeout = 0;
Printf("%2d ", ttl);
for (probe = 0; probe < nprobes; ++probe) {
@@ -544,12 +545,14 @@ main(argc, argv)
break;
}
}
- if (cc == 0)
+ if (cc == 0) {
Printf(" *");
+ timeout++;
+ }
(void) fflush(stdout);
}
putchar('\n');
- if (got_there || unreachable >= nprobes)
+ if (got_there || (unreachable && (unreachable + timeout) >= nprobes))
exit(0);
}
}