Bug 30289

Summary: the route command evaluates arguments in an undocumented and wrong way
Product: Base System Reporter: do not answer to this address - it's gonna go again <wefa>
Component: binAssignee: ru <ru>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.3-RELEASE   
Hardware: Any   
OS: Any   

Description do not answer to this address - it's gonna go again 2001-09-03 19:00:01 UTC
a wrong but not uncommon command line leads to very strange results:


nxcon# 18:16 [img]route add 192.168.78.0 255.255.255.0 192.168.77.1
add net 192.168.78.0: gateway 255.255.255.0

nxcon# 18:16 [img]route -n get 192.168.78.4
   route to: 192.168.78.4
destination: 192.168.76.0
       mask: 192.168.77.1
    gateway: 255.255.255.0
  interface: xl0
      flags: <UP,GATEWAY,DONE,STATIC,PRCLONING>
 recvpipe  sendpipe  ssthresh  rtt,msec    rttvar  hopcount      mtu     expire
       0         0         0         0         0         0      1500         0 

The problem here is obvious - but in other circumstances this could
produce an 'apparently working system' (ping works to some target host)
but which is completely wrong.

according to the man page route should
	- consider the address a host address 
	- ignore the third parameter

in my opinion, route should instead
	- recognize the illegal parameter
	- abort with an error message

Unfortunately it does neither.

(Of course it also could recognize and correctly evaluate the 
statement as intended, but that's a matter of design and not 
the issue here.)

How-To-Repeat: 	see above
Comment 1 ru freebsd_committer freebsd_triage 2001-09-04 08:13:04 UTC
State Changed
From-To: open->closed

This is the documented syntax, please consult the route(8) manpage: 

: The other commands have the following syntax: 
:  
:       route [-n] command [-net | -host] destination gateway [netmask] 

Note the optional third parameter.  If specified, it's treated like if 
-netmask <netmask> was specified. 


Comment 2 ru freebsd_committer freebsd_triage 2001-09-04 08:13:04 UTC
Responsible Changed
From-To: freebsd-bugs->ru