Date: Sun, 25 Aug 2013 20:51:38 +0200 From: Kurt Jaeger <fbsd-pr@opsec.eu> To: FreeBSD-gnats-submit@freebsd.org Cc: pawel@FreeBSD.org Subject: bin/181532: 'route get' without destination gives misleading error message Message-ID: <E1VDfPW-000MD0-6C@home.opsec.eu> Resent-Message-ID: <201308251900.r7PJ00NZ053804@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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@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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E1VDfPW-000MD0-6C>