NetBSD Problem Report #47304

From www@NetBSD.org  Mon Dec 10 11:24:59 2012
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	by www.NetBSD.org (Postfix) with ESMTP id 1DB4A63E4E4
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 10 Dec 2012 11:24:59 +0000 (UTC)
Message-Id: <20121210112458.21F7663E4E4@www.NetBSD.org>
Date: Mon, 10 Dec 2012 11:24:58 +0000 (UTC)
From: kaishuu0123@gmail.com
Reply-To: kaishuu0123@gmail.com
To: gnats-bugs@NetBSD.org
Subject: traceroute6: can't work -s (source IPv6 address to be used) option
X-Send-Pr-Version: www-1.0

>Number:         47304
>Category:       bin
>Synopsis:       traceroute6: can't work -s (source IPv6 address to be used) option
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Dec 10 11:25:00 +0000 2012
>Closed-Date:    Thu Aug 10 01:26:17 +0000 2017
>Last-Modified:  Thu Aug 10 01:26:17 +0000 2017
>Originator:     Kouki Ooyatsu
>Release:        NetBSD-current
>Organization:
Personal
>Environment:
>Description:
traceroute6:

can't bind as the source address, even if you specify the correct source IPv6 address.

>How-To-Repeat:
$ traceroute -s <valid source address> 2001:db8::1
traceroute6: bind: Can't assign requested address

>Fix:
variable 'res' is stored in the destination address.
valid variable is 'res0'.

cvs diff: Diffing .
Index: traceroute6.c
===================================================================
RCS file: /cvsroot/NetBSD/src/usr.sbin/traceroute6/traceroute6.c,v
retrieving revision 1.42
diff -u -p -r1.42 traceroute6.c
--- traceroute6.c       4 Jan 2012 16:09:44 -0000     1.42
+++ traceroute6.c       10 Dec 2012 11:21:31 -0000
@@ -724,10 +724,10 @@ main(int argc, char *argv[])
            if (error0)
              errx(1, "Cannot get address for `%s' (%s)", source,
                  gai_strerror(error0));
-           if (res->ai_addrlen > sizeof(Src))
+           if (res0->ai_addrlen > sizeof(Src))
              errx(1, "Bad incompatible address length");
-           memcpy(&Src, res->ai_addr, res->ai_addrlen);
-           freeaddrinfo(res);
+           memcpy(&Src, res0->ai_addr, res0->ai_addrlen);
+           freeaddrinfo(res0);
        } else {
            struct sockaddr_in6 Nxt;
            int dummy;

>Release-Note:

>Audit-Trail:
From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/47304 CVS commit: src/usr.sbin/traceroute6
Date: Mon, 10 Dec 2012 13:11:34 -0500

 Module Name:	src
 Committed By:	christos
 Date:		Mon Dec 10 18:11:34 UTC 2012

 Modified Files:
 	src/usr.sbin/traceroute6: traceroute6.c

 Log Message:
 PR/47304: Kouki Ooyatsu: -s (source IPv6 address to be used) option does not
 work because the wrong variable is used.
 XXX: Pullup to 6.


 To generate a diff of this commit:
 cvs rdiff -u -r1.42 -r1.43 src/usr.sbin/traceroute6/traceroute6.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Soren Jacobsen" <snj@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/47304 CVS commit: [netbsd-6] src/usr.sbin/traceroute6
Date: Thu, 6 Jul 2017 15:25:57 +0000

 Module Name:	src
 Committed By:	snj
 Date:		Thu Jul  6 15:25:57 UTC 2017

 Modified Files:
 	src/usr.sbin/traceroute6 [netbsd-6]: traceroute6.c

 Log Message:
 Pull up following revision(s) (requested by is in ticket #1427):
 	usr.sbin/traceroute6/traceroute6.c: revision 1.43
 PR/47304: Kouki Ooyatsu: -s (source IPv6 address to be used) option does not
 work because the wrong variable is used.


 To generate a diff of this commit:
 cvs rdiff -u -r1.42 -r1.42.2.1 src/usr.sbin/traceroute6/traceroute6.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: ginsbach@NetBSD.org
State-Changed-When: Thu, 10 Aug 2017 01:26:17 +0000
State-Changed-Why:
christos committed fix long ago; recently pulled up to netbsd-6.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.