Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 May 2007 13:43:48 GMT
From:      Colin Petrie<cpetrie@xcalibre.co.uk>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/112303: 'route get' returns wrong exit code if no match
Message-ID:  <200705011343.l41DhmfE020416@www.freebsd.org>
Resent-Message-ID: <200705011350.l41Do3TE019839@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         112303
>Category:       bin
>Synopsis:       'route get' returns wrong exit code if no match
>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:   Tue May 01 13:50:02 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Colin Petrie
>Release:        6.2-RELEASE
>Organization:
>Environment:
FreeBSD xxx.xxx.xxx 6.2-RELEASE FreeBSD 6.2-RELEASE #1: Mon Mar 26 18:27:24 BST 2007     root@xxx.xxx.xxx:/usr/src/sys/i386/compile/CUSTOM  i386

>Description:
When using 'route get' to display the routing table entry for an IP address, if there is no matching table entry, the command outputs an error to STDERR, but exits with a exit code of 0.

Given that the message is output to STDERR, this would suggest that the route command considers this to be an error, therefore should it not exit with a non-zero exit code?
>How-To-Repeat:
# route get www.google.com
   route to: lm-in-f147.google.com
destination: 66.102.8.0
       mask: 255.255.254.0
    gateway: tr1
  interface: vlan401
      flags: <UP,GATEWAY,DONE,PROTO1>
 recvpipe  sendpipe  ssthresh  rtt,msec    rttvar  hopcount      mtu     expire
       0         0         0         0         0         0      1500         0 
# echo $?
0

# route get 192.168.1.1
route: writing to routing socket: No such process
# echo $?
0


>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200705011343.l41DhmfE020416>