From eau@eauge.fr.cw.net  Wed May 28 08:47:52 2003
Return-Path: <eau@eauge.fr.cw.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 6475937B401
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 28 May 2003 08:47:52 -0700 (PDT)
Received: from eauge.fr.cw.net (eauge.fr.cw.net [62.4.0.126])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 7DFD443FBD
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 28 May 2003 08:47:51 -0700 (PDT)
	(envelope-from eau@eauge.fr.cw.net)
Received: (from eau@localhost)
	by eauge.fr.cw.net (8.12.6p2/8.12.6/Submit) id h4SFix5h000784;
	Wed, 28 May 2003 17:44:59 +0200 (CEST)
	(envelope-from eau)
Message-Id: <200305281544.h4SFix5h000784@eauge.fr.cw.net>
Date: Wed, 28 May 2003 17:44:59 +0200 (CEST)
From: Eric AUGE <eauge@fr.cw.net>
Reply-To: Eric AUGE <eauge@fr.cw.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: bogus default IP route (netstat -rn/route add) handling/display.
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         52758
>Category:       bin
>Synopsis:       bogus default IP route (netstat -rn/route add) handling/display.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    ru
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed May 28 08:50:12 PDT 2003
>Closed-Date:    Wed May 28 22:37:44 PDT 2003
>Last-Modified:  Wed May 28 22:37:44 PDT 2003
>Originator:     Eric AUGE
>Release:        FreeBSD 5.0-RELEASE-p7 i386
>Organization:
no
>Environment:
System: FreeBSD eauge.fr.cw.net 5.0-RELEASE-p7 FreeBSD 5.0-RELEASE-p7 #2: Mon Mar 31 15:41:21 CEST 2003 root@eauge.fr.cw.net:/usr/obj/usr/src/sys/EAUGE-5 i386

CPU: Pentium III/Pentium III Xeon/Celeron (701.59-MHz 686-class CPU)

>Description:

	First i add IP default bogus routes by giving a bad netmask value 
        (i assume it's netmask according to man (8) route)

	root@eauge ~ # route add default 200.200.200.200 10.10.10.10 
	add net default: gateway 200.200.200.200
 	root@eauge ~ # route add default 127.0.0.45 62.4.8.9 10.0.0.0
	...
	...
	root@eauge ~ # route add default 127.0.0.3 62.4.1.125
	...

	After Adding looking at the IP routes show strange entries,
	and everything still works correctly, this work with local
	and remote bogus addresses, then some hosts (cvsup2.fr.freebsd.org) just doesn't work 
	with standards errors and then works again, etc...

	root@eauge ~ # netstat -rn -f inet
	Routing tables

	Internet:
	Destination        Gateway            Flags    Refs      Use  Netif Expire
	0&0xa0a0a0a        200.200.200.200    UGSc        0        0    lo0 =>
	0&0x3e040809       127.0.0.45         UGSc        0        0    lo0 =>
	0&0x3e04017d       127.0.0.3          UGSc        0        0    lo0 =>
	0&0xffffff18       127.0.0.3          UGSc        0        0    lo0 =>
	0&0x64646464       127.0.0.2          UGSc        0        0    lo0 =>
	0&0x3e0403fe       127.0.0.2          UGSc        0        0    lo0 =>
	0&0x3e0402fe       127.0.0.1          UGSc        0        0    lo0 =>
	0&0x1010101        127.0.0.2          UGSc        2        0    lo0 =>
	0&0xa000000        127.0.0.3          UGSc        0        0    lo0 =>
	default            62.4.1.254         UGSc       16      393   fxp0
	62.4/23            link#1             UC          2        0   fxp0
	62.4.0.126         127.0.0.1          UGHS        0        0    lo0
	62.4.0.254         00:03:6b:c0:e8:80  UHLW        0        0   fxp0    433
	62.4.1.254         00:03:6b:c0:e8:80  UHLW        7        0   fxp0    981
	127.0.0.1          127.0.0.1          UH          2      216    lo0


>How-To-Repeat:
	Just insert bogus routes, using the commands above to see.
>Fix:
	No fix yet, working on a patch.



>Release-Note:
>Audit-Trail:

From: Ruslan Ermilov <ru@FreeBSD.org>
To: Eric AUGE <eauge@fr.cw.net>
Cc: bug-followup@FreeBSD.org
Subject: Re: bin/52758: bogus default IP route (netstat -rn/route add) handling/display.
Date: Wed, 28 May 2003 21:34:31 +0300

 There's nothing unexpected here; route(8) displays non-contiguous
 netmasks this way: key&netmask.  The default route is the route
 with both key and mask of all zeroes, by definition.  When you
 specify a third argument (netmask), it becomes non-default, but
 rather a ``-net 0 -netmask <netmask>''.
 
 On Wed, May 28, 2003 at 05:44:59PM +0200, Eric AUGE wrote:
 > 
 > >Number:         52758
 > >Category:       bin
 > >Synopsis:       bogus default IP route (netstat -rn/route add) handling/display.
 > >Confidential:   no
 > >Severity:       non-critical
 > >Priority:       low
 > >Responsible:    freebsd-bugs
 > >State:          open
 > >Quarter:        
 > >Keywords:       
 > >Date-Required:
 > >Class:          sw-bug
 > >Submitter-Id:   current-users
 > >Arrival-Date:   Wed May 28 08:50:12 PDT 2003
 > >Closed-Date:
 > >Last-Modified:
 > >Originator:     Eric AUGE
 > >Release:        FreeBSD 5.0-RELEASE-p7 i386
 > >Organization:
 > no
 > >Environment:
 > System: FreeBSD eauge.fr.cw.net 5.0-RELEASE-p7 FreeBSD 5.0-RELEASE-p7 #2: Mon Mar 31 15:41:21 CEST 2003 root@eauge.fr.cw.net:/usr/obj/usr/src/sys/EAUGE-5 i386
 > 
 > CPU: Pentium III/Pentium III Xeon/Celeron (701.59-MHz 686-class CPU)
 > 
 > >Description:
 > 
 > 	First i add IP default bogus routes by giving a bad netmask value 
 >         (i assume it's netmask according to man (8) route)
 > 
 > 	root@eauge ~ # route add default 200.200.200.200 10.10.10.10 
 > 	add net default: gateway 200.200.200.200
 >  	root@eauge ~ # route add default 127.0.0.45 62.4.8.9 10.0.0.0
 > 	...
 > 	...
 > 	root@eauge ~ # route add default 127.0.0.3 62.4.1.125
 > 	...
 > 
 > 	After Adding looking at the IP routes show strange entries,
 > 	and everything still works correctly, this work with local
 > 	and remote bogus addresses, then some hosts (cvsup2.fr.freebsd.org) just doesn't work 
 > 	with standards errors and then works again, etc...
 > 
 > 	root@eauge ~ # netstat -rn -f inet
 > 	Routing tables
 > 
 > 	Internet:
 > 	Destination        Gateway            Flags    Refs      Use  Netif Expire
 > 	0&0xa0a0a0a        200.200.200.200    UGSc        0        0    lo0 =>
 > 	0&0x3e040809       127.0.0.45         UGSc        0        0    lo0 =>
 > 	0&0x3e04017d       127.0.0.3          UGSc        0        0    lo0 =>
 > 	0&0xffffff18       127.0.0.3          UGSc        0        0    lo0 =>
 > 	0&0x64646464       127.0.0.2          UGSc        0        0    lo0 =>
 > 	0&0x3e0403fe       127.0.0.2          UGSc        0        0    lo0 =>
 > 	0&0x3e0402fe       127.0.0.1          UGSc        0        0    lo0 =>
 > 	0&0x1010101        127.0.0.2          UGSc        2        0    lo0 =>
 > 	0&0xa000000        127.0.0.3          UGSc        0        0    lo0 =>
 > 	default            62.4.1.254         UGSc       16      393   fxp0
 > 	62.4/23            link#1             UC          2        0   fxp0
 > 	62.4.0.126         127.0.0.1          UGHS        0        0    lo0
 > 	62.4.0.254         00:03:6b:c0:e8:80  UHLW        0        0   fxp0    433
 > 	62.4.1.254         00:03:6b:c0:e8:80  UHLW        7        0   fxp0    981
 > 	127.0.0.1          127.0.0.1          UH          2      216    lo0
 > 
 > 
 > >How-To-Repeat:
 > 	Just insert bogus routes, using the commands above to see.
 > >Fix:
 > 	No fix yet, working on a patch.
 
 -- 
 Ruslan Ermilov		Sysadmin and DBA,
 ru@sunbay.com		Sunbay Software AG,
 ru@FreeBSD.org		FreeBSD committer.

From: Eric AUGE <eric.auge@cw.com>
To: Ruslan Ermilov <ru@FreeBSD.org>
Cc: Eric AUGE <eauge@fr.cw.net>, bug-followup@FreeBSD.org
Subject: Re: bin/52758: bogus default IP route (netstat -rn/route add)
 handling/display.
Date: Thu, 29 May 2003 05:13:53 +0200 (CEST)

 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
 On Wed, 28 May 2003, Ruslan Ermilov wrote:
 
 ru >There's nothing unexpected here; route(8) displays non-contiguous
 ru >netmasks this way: key&netmask.  The default route is the route
 ru >with both key and mask of all zeroes, by definition.  When you
 ru >specify a third argument (netmask), it becomes non-default, but
 ru >rather a ``-net 0 -netmask <netmask>''.
 
 ok i didn't know about the output format,
 and i didn't know why i was believing that it did check
 if the next hop was within the address space of one
 the interfaces (physical or logical).
 
 thanks bringing this to me, i might have just missed it
 in route(8).
 
 Best Regards,
 
 Eric.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.2.1 (FreeBSD)
 
 iD8DBQE+1Xr0L/U5psk9l1gRAsgNAJ9DL/DNdyKjvi/dmc0OkNDyhm6vrACgntgC
 zfxWUYytTG/VFuldLToGcFA=
 =EKhN
 -----END PGP SIGNATURE-----
 
State-Changed-From-To: open->closed 
State-Changed-By: ru 
State-Changed-When: Wed May 28 22:36:54 PDT 2003 
State-Changed-Why:  
Asked and answered. 


Responsible-Changed-From-To: freebsd-bugs->ru 
Responsible-Changed-By: ru 
Responsible-Changed-When: Wed May 28 22:36:54 PDT 2003 
Responsible-Changed-Why:  

http://www.freebsd.org/cgi/query-pr.cgi?pr=52758 
>Unformatted:
