bin/112303: 'route get' returns wrong exit code if no match
Colin Petrie
cpetrie at xcalibre.co.uk
Tue May 1 13:50:03 UTC 2007
>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 at 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:
More information about the freebsd-bugs
mailing list