summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2015-10-01 22:21:49 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2015-10-01 22:21:49 +0000
commitde646d1828db4b38db68b5bc745d5a361b4c3080 (patch)
tree6ee1999de914d03f06b16d6608dd414128932d27 /sys
parentcda40dee7e2aad1a231fd0a9d6fa2acdf2982501 (diff)
Revert previous, it also breaks naddy@'s nested NFS setup.
Diffstat (limited to 'sys')
-rw-r--r--sys/net/route.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/net/route.c b/sys/net/route.c
index 2c1eb6f4108..20c96d8733a 100644
--- a/sys/net/route.c
+++ b/sys/net/route.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.c,v 1.245 2015/09/30 10:47:39 mpi Exp $ */
+/* $OpenBSD: route.c,v 1.246 2015/10/01 22:21:48 mpi Exp $ */
/* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */
/*
@@ -1171,8 +1171,14 @@ rt_checkgate(struct ifnet *ifp, struct rtentry *rt, struct sockaddr *dst,
KASSERT(rt != NULL);
- if ((rt->rt_flags & RTF_UP) == 0)
- return (EHOSTUNREACH);
+ if ((rt->rt_flags & RTF_UP) == 0) {
+ rt = rtalloc(dst, RT_REPORT|RT_RESOLVE, rtableid);
+ if (rt == NULL)
+ return (EHOSTUNREACH);
+ rt->rt_refcnt--;
+ if (rt->rt_ifp != ifp)
+ return (EHOSTUNREACH);
+ }
rt0 = rt;