From owner-freebsd-bugs Mon Sep 23 01:50:06 1996 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id BAA02752 for bugs-outgoing; Mon, 23 Sep 1996 01:50:06 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id BAA02736; Mon, 23 Sep 1996 01:50:04 -0700 (PDT) Resent-Date: Mon, 23 Sep 1996 01:50:04 -0700 (PDT) Resent-Message-Id: <199609230850.BAA02736@freefall.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.FreeBSD.org, marcs@alive.ampr.ab.ca 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 ; 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 X-Send-Pr-Version: 3.2 Subject: bin/1668: traceroute -q1 only goes one hop before exiting Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >Number: 1668 >Category: bin >Synopsis: traceroute -q1 only goes one hop before exiting >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Sep 23 01:50:02 PDT 1996 >Last-Modified: >Originator: Marc Slemko >Organization: >Release: FreeBSD 2.1-STABLE i386 >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); >Audit-Trail: >Unformatted: