bin/181532: 'route get' without destination gives misleading error message
Kurt Jaeger
fbsd-pr at opsec.eu
Sun Aug 25 19:00:00 UTC 2013
>Number: 181532
>Category: bin
>Synopsis: 'route get' without destination gives misleading error message
>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: Sun Aug 25 19:00:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator: Kurt Jaeger
>Release: FreeBSD 9.1-RELEASE amd64
>Organization:
-
>Environment:
System: FreeBSD home.opsec.eu 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243825: Tue Dec 4 09:23:10 UTC 2012 root at farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64
>Description:
If you type
route get
the error message is strange/misleading:
route: writing to routing socket: Invalid argument
The patch changes this to:
route get requires a parameter, try 'default'
>How-To-Repeat:
route get
>Fix:
--- route.c 2012-12-03 19:43:01.000000000 +0100
+++ /usr/home/pi/src/route/route.c 2013-08-25 20:46:13.000000000 +0200
@@ -1229,6 +1229,11 @@
if (rtm_addrs & RTA_NETMASK)
mask_addr();
+ if ( so_dst.sa.sa_len == 0 && cmd == RTM_GET ) {
+ fprintf(stderr,
+ "route get requires a parameter, try 'default'\n");
+ exit(1);
+ }
NEXTADDR(RTA_DST, so_dst);
NEXTADDR(RTA_GATEWAY, so_gate);
NEXTADDR(RTA_NETMASK, so_mask);
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list