From alive.ampr.ab.ca!marcs@ve6kik.ampr.ab.ca  Mon Sep 23 01:47:24 1996
Received: from scapa.cs.ualberta.ca (root@scapa.cs.ualberta.ca [129.128.4.44])
          by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id BAA01838
          for <FreeBSD-gnats-submit@freebsd.org>; Mon, 23 Sep 1996 01:47:22 -0700 (PDT)
Received: from ve6kik by scapa.cs.ualberta.ca with UUCP id <13064-20507>; Mon, 23 Sep 1996 02:47:14 -0600
Received: by ve6kik.ampr.ab.ca (Smail3.1.28.1 #5)
	id m0v4gJH-000OH7C; Sat, 21 Sep 96 22:38 WET DST
Received: (from marcs@localhost) by alive.ampr.ab.ca (8.7.5/8.7.3) id PAA27600; Sat, 21 Sep 1996 15:57:10 -0600 (MDT)
Message-Id: <199609212157.PAA27600@alive.ampr.ab.ca>
Date: Sat, 21 Sep 1996 15:57:10 -0600 (MDT)
From: marcs@alive.ampr.ab.ca
Reply-To: marcs@alive.ampr.ab.ca
To: FreeBSD-gnats-submit@freebsd.org
Subject: traceroute -q1 only goes one hop before exiting
X-Send-Pr-Version: 3.2

>Number:         1668
>Category:       bin
>Synopsis:       traceroute -q1 only goes one hop before exiting
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Sep 23 01:50:02 PDT 1996
>Closed-Date:    Mon Sep 30 12:51:54 PDT 1996
>Last-Modified:  Mon Sep 30 12:54:57 PDT 1996
>Originator:     Marc Slemko
>Release:        FreeBSD 2.1-STABLE i386
>Organization:
>Environment:

traceroute from either 2.1.5 or -current; that code hasn't changed.

>Description:

When I do a 'traceroute -q 1 destination', traceroute always exits
after the first hop.  This is because of a comparison on line 641 of
1.11 of traceroute.c which is designed to have traceroute exit if
the destination has been reached, or ICMP unreachable messages have
come back for (nearly) each packet sent to the host.  I'm thinking
that perhaps the original intent of the line was to allow for one
unreachable to be lost and still exit.

>How-To-Repeat:

'traceroute -q 1 anyhost', where anyhost is any host you feel like that
is more than one hop away from you.

>Fix:

The below patch fixes this problem, and shows where the problem
is, but I'm not sure of all the possible conditions that the author
is trying to deal with in the code, so the patch may well break
something else.

--- traceroute.c	1996/09/10 00:50:13	1.11
+++ traceroute.c	1996/09/21 21:51:13
@@ -638,7 +638,7 @@
 			(void) fflush(stdout);
 		}
 		putchar('\n');
-		if (got_there || unreachable >= nprobes-1)
+		if (got_there || unreachable >= nprobes)
 			exit(0);
 	}
 	exit(0);

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: fenner 
State-Changed-When: Mon Sep 30 12:51:54 PDT 1996 
State-Changed-Why:  
Fixed by importing LBL traceroute version 1.3.2, which has this bug fixed. 
>Unformatted:
