At $WORK, we have observed that if you attempt to add a route with the -iface flag, but you specify an incorrect interface name, the route command will perform a DNS lookup of the interface name. It appears that if the DNS lookup succeeds that it will treat the parameter to -iface as if it were a gateway for the route and not an interface.
This appears to be a simple bug. This patch resolves the issue for me, but I'm a bit worried that the fallback to a DNS lookup might actually be desired behaviour in some case. Does anybody have any ideas? diff --git a/sbin/route/route.c b/sbin/route/route.c index 1bce41e..a447a45 100644 --- a/sbin/route/route.c +++ b/sbin/route/route.c @@ -1222,6 +1222,9 @@ getaddr(int idx, char *str, struct hostent **hpp, int nrflags) freeifaddrs(ifap); if (sdl != NULL) return(1); + else + errx(EX_DATAERR, + "inferface '%s' does not exist", str); } break; case RTAX_IFP: _______________________________________________ freebsd-net@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-net To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"