NetBSD Problem Report #49371

From www@NetBSD.org  Thu Nov  6 17:46:59 2014
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 0A1D3A65D2
	for <gnats-bugs@gnats.NetBSD.org>; Thu,  6 Nov 2014 17:46:59 +0000 (UTC)
Message-Id: <20141106174657.C857AA667D@mollari.NetBSD.org>
Date: Thu,  6 Nov 2014 17:46:57 +0000 (UTC)
From: epoch@hacking.allowed.org
Reply-To: epoch@hacking.allowed.org
To: gnats-bugs@NetBSD.org
Subject: ipv6 routes missing netmasks
X-Send-Pr-Version: www-1.0

>Number:         49371
>Category:       kern
>Synopsis:       ipv6 routes missing netmasks
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Nov 06 17:50:00 +0000 2014
>Closed-Date:    Fri Feb 09 20:38:24 +0000 2018
>Last-Modified:  Fri Feb 09 20:38:24 +0000 2018
>Originator:     epoch
>Release:        6.1.4
>Organization:
hacking.allowed
>Environment:
NetBSD armitage 6.1.4 NetBSD 6.1.4 (ARMITAGE) #5: Fri Oct 24 23:27:16 CDT 2014  root@armitage:/usr/obj/sys/arch/i386/compile/ARMITAGE i386
>Description:
Something isn't treating ipv6 routes right. I noticed that netstat gets the netmasks right, but route doesn't. This bug also affects the Bird Internet Routing Daemon and probably any other program that reads the routes from the kernel routing table in the same way they both do. I'm not sure if this counts as a kernel bug for breaking the interface route uses or a userland program problem for not acting the way netstat does.
>How-To-Repeat:
compare the outputs of:
netstat -rnf inet6
and
route -n show -inet6

example:
bash-4.3# route -n show -inet6 | head -n 17 | tail -n5
2001:470:1f10:a1c::1               2001:470:1f10:a1c::2           UH
2001:470:1f10:a1c::2               link#4                         UHL
2001:470:1f11:a1c::                link#1                         U
2001:470:1f11:a1c::1               00:30:84:27:05:11              UHL
2001:db8::                         ::1                            UGR
bash-4.3# netstat -rnf inet6 | head -n17 | tail -n5
2001:470:1f10:a1c::1               2001:470:1f10:a1c::2           UH          1        0      -  gif0
2001:470:1f10:a1c::2               link#4             UHL         1        0      -  lo0
2001:470:1f11:a1c::/64             link#1             UC          0        0      -  rtk0
2001:470:1f11:a1c::1               00:30:84:27:05:11  UHL         0      245      -  lo0
2001:db8::/32                      ::1                            UGRS        0        0      -  lo0


>Fix:
Sorry, I don't know.

>Release-Note:

>Audit-Trail:
From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org, 
	gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Cc: 
Subject: Re: kern/49371: ipv6 routes missing netmasks
Date: Thu, 6 Nov 2014 16:28:46 -0500

 On Nov 6,  5:50pm, epoch@hacking.allowed.org (epoch@hacking.allowed.org) wrote:
 -- Subject: kern/49371: ipv6 routes missing netmasks

 | >Number:         49371
 | >Category:       kern
 | >Synopsis:       ipv6 routes missing netmasks
 | >Confidential:   no
 | >Severity:       non-critical
 | >Priority:       medium
 | >Responsible:    kern-bug-people
 | >State:          open
 | >Class:          sw-bug
 | >Submitter-Id:   net
 | >Arrival-Date:   Thu Nov 06 17:50:00 +0000 2014
 | >Originator:     epoch
 | >Release:        6.1.4
 | >Organization:
 | hacking.allowed
 | >Environment:
 | NetBSD armitage 6.1.4 NetBSD 6.1.4 (ARMITAGE) #5: Fri Oct 24 23:27:16 CDT 2014  root@armitage:/usr/obj/sys/arch/i386/compile/ARMITAGE i386
 | >Description:
 | Something isn't treating ipv6 routes right. I noticed that netstat gets the netmasks right, but route doesn't. This bug also affects the Bird Internet Routing Daemon and probably any other program that reads the routes from the kernel routing table in the same way they both do. I'm not sure if this counts as a kernel bug for breaking the interface route uses or a userland program problem for not acting the way netstat does.

 The problem is that the formatting is done suboptimally in /sbin/route.
 The information is there and correct in the kernel.

From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/49371 CVS commit: src/sbin/route
Date: Thu, 6 Nov 2014 16:29:32 -0500

 Module Name:	src
 Committed By:	christos
 Date:		Thu Nov  6 21:29:32 UTC 2014

 Modified Files:
 	src/sbin/route: Makefile extern.h prog_ops.h route.c show.c
 Added Files:
 	src/sbin/route: rtutil.c rtutil.h

 Log Message:
 Factor out the netstat route printing code and use it here. There is no
 point in having 2 different copies; fixes PR/49371


 To generate a diff of this commit:
 cvs rdiff -u -r1.25 -r1.26 src/sbin/route/Makefile
 cvs rdiff -u -r1.14 -r1.15 src/sbin/route/extern.h
 cvs rdiff -u -r1.2 -r1.3 src/sbin/route/prog_ops.h
 cvs rdiff -u -r1.144 -r1.145 src/sbin/route/route.c
 cvs rdiff -u -r0 -r1.1 src/sbin/route/rtutil.c src/sbin/route/rtutil.h
 cvs rdiff -u -r1.45 -r1.46 src/sbin/route/show.c

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

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/49371 CVS commit: [netbsd-7] src
Date: Thu, 8 Jan 2015 11:01:01 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Thu Jan  8 11:01:01 UTC 2015

 Modified Files:
 	src/distrib/utils/x_route [netbsd-7]: Makefile
 	src/sbin/route [netbsd-7]: Makefile extern.h prog_ops.h route.c show.c
 	src/usr.bin/netstat [netbsd-7]: Makefile if.c main.c mroute.c mroute6.c
 	    netstat.h route.c
 Added Files:
 	src/sbin/route [netbsd-7]: rtutil.c rtutil.h
 Removed Files:
 	src/usr.bin/netstat [netbsd-7]: show.c

 Log Message:
 Pull up following revision(s) (requested by prlw1 in ticket #390):
 	usr.bin/netstat/mroute.c: revision 1.25
 	usr.bin/netstat/Makefile: revision 1.40
 	sbin/route/prog_ops.h: revision 1.3
 	sbin/route/rtutil.c: revision 1.1
 	sbin/route/rtutil.h: revision 1.1
 	usr.bin/netstat/mroute6.c: revision 1.15
 	sbin/route/extern.h: revision 1.15
 	usr.bin/netstat/show.c: file removal
 	usr.bin/netstat/main.c: revision 1.93
 	usr.bin/netstat/route.c: revision 1.83
 	usr.bin/netstat/netstat.h: revision 1.51
 	distrib/utils/x_route/Makefile: revision 1.18
 	sbin/route/show.c: revision 1.46
 	usr.bin/netstat/if.c: revision 1.80
 	sbin/route/route.c: revision 1.145
 	sbin/route/Makefile: revision 1.26
 Factor out the netstat route printing code and use it here. There is no
 point in having 2 different copies; fixes PR/49371


 To generate a diff of this commit:
 cvs rdiff -u -r1.17 -r1.17.26.1 src/distrib/utils/x_route/Makefile
 cvs rdiff -u -r1.25 -r1.25.24.1 src/sbin/route/Makefile
 cvs rdiff -u -r1.14 -r1.14.24.1 src/sbin/route/extern.h
 cvs rdiff -u -r1.2 -r1.2.24.1 src/sbin/route/prog_ops.h
 cvs rdiff -u -r1.144.4.1 -r1.144.4.2 src/sbin/route/route.c
 cvs rdiff -u -r0 -r1.4.2.2 src/sbin/route/rtutil.c
 cvs rdiff -u -r0 -r1.3.2.2 src/sbin/route/rtutil.h
 cvs rdiff -u -r1.45 -r1.45.8.1 src/sbin/route/show.c
 cvs rdiff -u -r1.39 -r1.39.8.1 src/usr.bin/netstat/Makefile
 cvs rdiff -u -r1.79 -r1.79.4.1 src/usr.bin/netstat/if.c
 cvs rdiff -u -r1.91 -r1.91.2.1 src/usr.bin/netstat/main.c
 cvs rdiff -u -r1.24 -r1.24.10.1 src/usr.bin/netstat/mroute.c
 cvs rdiff -u -r1.14 -r1.14.4.1 src/usr.bin/netstat/mroute6.c
 cvs rdiff -u -r1.50 -r1.50.2.1 src/usr.bin/netstat/netstat.h
 cvs rdiff -u -r1.82 -r1.82.2.1 src/usr.bin/netstat/route.c
 cvs rdiff -u -r1.20 -r0 src/usr.bin/netstat/show.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: maxv@NetBSD.org
State-Changed-When: Fri, 09 Feb 2018 20:38:24 +0000
State-Changed-Why:
Fixed and pulled up to -7.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.