summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2016-12-14 20:35:21 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2016-12-14 20:35:21 +0000
commitc09471df0ae18ca50af982c5fdda5f9c43f55220 (patch)
tree79b3580fbfbe253a8a8719cfb479a190d4bcac57 /sys/net
parentef3f93c9252e62f746996ef1497fe5c428b19afe (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.c4
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. */