From wefa@nxcon.nexgo.lab.arcor.de  Mon Sep  3 10:51:42 2001
Return-Path: <wefa@nxcon.nexgo.lab.arcor.de>
Received: from nxcon.nexgo.lab.arcor.de (nxcon.nexgo.lab.arcor.de [145.253.194.34])
	by hub.freebsd.org (Postfix) with ESMTP id 8703837B405
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  3 Sep 2001 10:51:41 -0700 (PDT)
Received: (from wefa@localhost)
	by nxcon.nexgo.lab.arcor.de (8.11.3/8.9.3) id f83HpcF71005;
	Mon, 3 Sep 2001 19:51:38 +0200 (CEST)
	(envelope-from wefa)
Message-Id: <200109031751.f83HpcF71005@nxcon.nexgo.lab.arcor.de>
Date: Mon, 3 Sep 2001 19:51:38 +0200 (CEST)
From: Christoph Weber-Fahr <wefa@nxcon.nexgo.lab.arcor.de>
Reply-To: christoph.weber-fahr@arcor.net
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: route behaves strange
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         30289
>Category:       bin
>Synopsis:       the route command evaluates arguments in an undocumented and wrong way
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    ru
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Sep 03 11:00:01 PDT 2001
>Closed-Date:    Tue Sep 4 00:13:04 PDT 2001
>Last-Modified:  Tue Sep 04 00:16:56 PDT 2001
>Originator:     Christoph Weber-Fahr
>Release:        FreeBSD 4.3-RELEASE i386
>Organization:
Arcor AG
>Environment:
System: FreeBSD nxcon.nexgo.lab.arcor.de 4.3-RELEASE FreeBSD 4.3-RELEASE #0: Thu Jul 26 19:41:55 CEST 2001 root@nxcon.nexgo.lab.arcor.de:/dat/cvsup/src/sys/compile/NXCON i386

>Description:

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
>Fix:

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: ru 
State-Changed-When: Tue Sep 4 00:13:04 PDT 2001 
State-Changed-Why:  
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. 


Responsible-Changed-From-To: freebsd-bugs->ru 
Responsible-Changed-By: ru 
Responsible-Changed-When: Tue Sep 4 00:13:04 PDT 2001 
Responsible-Changed-Why:  

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=30289 
>Unformatted:
