Bug 21562

Summary: route takes the netmask as the default gateway, creating a bad route.
Product: Base System Reporter: madamus <madamus>
Component: miscAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description madamus 2000-09-26 16:00:01 UTC
route -n add -net 10.150.200.0 255.255.252.0 10.125.200.199

will add a bad route to the system. A route that can't be deleted.

It looks like this using "netstat -rn"
Destination         Gateway            Flags      Netif Expire
default             10.125.204.1       UGSc        3        9     fxp0
10.20.200&0xa7dc8c7 255.255.252.0      UGSc        0        0     fxp0

the correct route command should be:
route -n add -net 10.150.200.0 -netmask 255.255.252.0 10.125.200.199

Comment: route should not allow this.

Fix: 

reboot
How-To-Repeat: Simply omit the "-netmask" when adding a new route.
Comment 1 Will Andrews freebsd_committer freebsd_triage 2000-09-26 17:33:59 UTC
State Changed
From-To: open->closed

Duplicate of PR#21561.