From 60c325372de33908aff95d74393cc4a025d99c38 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Fri, 16 Aug 1996 20:19:29 +0000 Subject: if time expired, cc = 0 & break to *; Havard.Eidnes@runit.sintef.no --- usr.sbin/traceroute/traceroute.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/usr.sbin/traceroute/traceroute.c b/usr.sbin/traceroute/traceroute.c index 2ebd12c2c93..80bfb6f775a 100644 --- a/usr.sbin/traceroute/traceroute.c +++ b/usr.sbin/traceroute/traceroute.c @@ -493,6 +493,10 @@ main(argc, argv) send_probe(++seq, ttl, &to); while (cc = wait_for_reply(s, &from, &t1)) { (void) gettimeofday(&t2, &tz); + if (t2.tv_sec - t1.tv_sec > waittime) { + cc = 0; + break; + } if ((i = packet_ok(packet, cc, &from, seq))) { if (from.sin_addr.s_addr != lastaddr) { print(packet, cc, &from); -- cgit v1.2.3