summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorrstone <rstone@FreeBSD.org>2016-01-05 16:58:07 +0000
committerrstone <rstone@FreeBSD.org>2016-01-05 16:58:07 +0000
commit81a34adc8a500c010fe7035400a945794073bc71 (patch)
tree0299856e4a08fab14864de7ac81c65ffda7daed8 /sbin
parent2586c96893c94ddbe9ba0492eeda316f75ce4787 (diff)
downloadFreeBSD-src-81a34adc8a500c010fe7035400a945794073bc71.zip
FreeBSD-src-81a34adc8a500c010fe7035400a945794073bc71.tar.gz
MFC r287920:
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
Diffstat (limited to 'sbin')
-rw-r--r--sbin/route/route.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sbin/route/route.c b/sbin/route/route.c
index 234aeef..f64f525 100644
--- a/sbin/route/route.c
+++ b/sbin/route/route.c
@@ -1239,6 +1239,9 @@ getaddr(int idx, char *str, struct hostent **hpp, int nrflags)
freeifaddrs(ifap);
if (sdl != NULL)
return(1);
+ else
+ errx(EX_DATAERR,
+ "interface '%s' does not exist", str);
}
break;
case RTAX_IFP:
OpenPOWER on IntegriCloud