bin/131365: route add changes interpretation of network specification

Vivek Khera vivek at khera.org
Wed Feb 4 07:50:06 PST 2009


>Number:         131365
>Category:       bin
>Synopsis:       route add changes interpretation of network specification
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Feb 04 15:50:02 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Vivek Khera
>Release:        FreeBSD 7.1-RELEASE-p2 amd64
>Organization:
>Environment:
System: FreeBSD mmfe1.m1e.net 7.1-RELEASE-p2 FreeBSD 7.1-RELEASE-p2 #0: Fri Jan 16 23:44:29 EST 2009 vivek at mmfe1.m1e.net:/n/lorax1/usr7/obj.amd64/n/lorax1/usr7/src/sys/KCI64SMP amd64


	
>Description:
	

In my /etc.rc.conf, I have a static route for my VPN connection to route the
internal address to my VPN router:

route_vpn1="-net 192.168 192.168.100.202"

Up through FreeBSD 7.0-REL (including all 5.x and 6.x releases), this was
interpreted by the route add command as 192.168.0.0/16.  As of FreeBSD 7.1 it
is treated as 192.168.0.0/24.  The only way to see this is to use netstat -rn
command, as netstat -r will show nothing different on a 7.0 vs a 7.1 machine.
Also pinging an address in the 192.168.x.y (where x > 0) range will try to use
the default route rather than the expected VPN route.

The man page has not changed to reflect this new behavior, either.

>How-To-Repeat:
	

add a static route like this:

route add -net 192.168 192.168.100.202

and view the routes with

netstat -rn

They will be different on 7.1 than any prior FreeBSD release.

>Fix:

	

the workaround is to explicitly specify the netmask:

route add -net 192.168/16 192.168.100.202


At minimum, the man page needs to be updated to reflect this, and I would have
expected an entry in UPDATING as I nearly lost access to this machine because
of the loss of the route.  I was lucky to have another local machine to access
it via the LAN.
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list