diff options
author | Stefan Sperling <stsp@cvs.openbsd.org> | 2016-12-14 20:35:21 +0000 |
---|---|---|
committer | Stefan Sperling <stsp@cvs.openbsd.org> | 2016-12-14 20:35:21 +0000 |
commit | c09471df0ae18ca50af982c5fdda5f9c43f55220 (patch) | |
tree | 79b3580fbfbe253a8a8719cfb479a190d4bcac57 /sys/net | |
parent | ef3f93c9252e62f746996ef1497fe5c428b19afe (diff) |
Make 'route add default' show a nicer error message if the provided
gateway is not reachable (e.g. not on a local subnet).
ok millert@ mikeb@ mpi@
(and shrugs by jca@)
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/route.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/net/route.c b/sys/net/route.c index a253e5f5b42..9919b9e036a 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route.c,v 1.342 2016/12/04 09:46:39 stsp Exp $ */ +/* $OpenBSD: route.c,v 1.343 2016/12/14 20:35:20 stsp Exp $ */ /* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */ /* @@ -397,7 +397,7 @@ rt_setgwroute(struct rtentry *rt, u_int rtableid) */ if (ISSET(nhrt->rt_flags, RTF_CLONING|RTF_GATEWAY)) { rtfree(nhrt); - return (ELOOP); + return (ENETUNREACH); } /* Next hop is valid so remove possible old cache. */ |