Date: Thu, 17 Sep 2015 16:56:49 +0000 (UTC) From: Ryan Stone <rstone@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287920 - head/sbin/route Message-ID: <201509171656.t8HGunFo087559@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rstone Date: Thu Sep 17 16:56:49 2015 New Revision: 287920 URL: https://svnweb.freebsd.org/changeset/base/287920 Log: Fix /sbin/route to never look up (invalid) interface names through DNS /sbin/route has a bug where if it is passed an interface name that does not exist, it falls through and winds up interpreting it as a hostname. It fails out eventually, but on a system where DNS lookup is broken you can end up waiting for up to 60 seconds waiting for the DNS lookup to timeout. I'm not quite sure what happens if the DNS lookup somehow succeeds but I doubt that can end well. Reviewed by: markj, cem MFC after: 2 weeks Sponsored by: EMC/Isilon Storage Division Modified: head/sbin/route/route.c Modified: head/sbin/route/route.c ============================================================================== --- head/sbin/route/route.c Thu Sep 17 16:38:32 2015 (r287919) +++ head/sbin/route/route.c Thu Sep 17 16:56:49 2015 (r287920) @@ -1222,6 +1222,9 @@ getaddr(int idx, char *str, struct hoste freeifaddrs(ifap); if (sdl != NULL) return(1); + else + errx(EX_DATAERR, + "interface '%s' does not exist", str); } break; case RTAX_IFP:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201509171656.t8HGunFo087559>