From f5c94c5f2b93468668d421c38d5c16416b66a7ad Mon Sep 17 00:00:00 2001 From: Martin Pieuchot Date: Wed, 2 Sep 2015 08:28:07 +0000 Subject: Revert the two uses of rtisvalid(9) for the moment, it breaks dhclient(8) configured networks on RAMDISK kernels. The problem is that the default route installed by dhclient(8) does not have the RTF_UP flag in this environement and rtisvalid(9) doesn't allow you to use a RTF_DOWN route. --- sys/netinet6/in6_src.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'sys/netinet6') diff --git a/sys/netinet6/in6_src.c b/sys/netinet6/in6_src.c index decbfce762e..9066cb37edd 100644 --- a/sys/netinet6/in6_src.c +++ b/sys/netinet6/in6_src.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6_src.c,v 1.52 2015/09/01 14:33:15 mpi Exp $ */ +/* $OpenBSD: in6_src.c,v 1.53 2015/09/02 08:28:06 mpi Exp $ */ /* $KAME: in6_src.c,v 1.36 2001/02/06 04:08:17 itojun Exp $ */ /* @@ -247,12 +247,13 @@ in6_selectsrc(struct in6_addr **in6src, struct sockaddr_in6 *dstsock, * our src addr is taken from the i/f, else punt. */ if (ro) { - if (!rtisvalid(ro->ro_rt) || - !IN6_ARE_ADDR_EQUAL(&ro->ro_dst.sin6_addr, dst)) { + if (ro->ro_rt && ((ro->ro_rt->rt_flags & RTF_UP) == 0 || + !IN6_ARE_ADDR_EQUAL(&ro->ro_dst.sin6_addr, dst))) { rtfree(ro->ro_rt); ro->ro_rt = NULL; } - if (ro->ro_rt == NULL) { + if (ro->ro_rt == (struct rtentry *)0 || + ro->ro_rt->rt_ifp == (struct ifnet *)0) { struct sockaddr_in6 *sa6; /* No route yet, so try to acquire one */ @@ -418,9 +419,10 @@ selectroute(struct sockaddr_in6 *dstsock, struct ip6_pktopts *opts, * cached destination, in case of sharing the cache with IPv4. */ if (ro) { - if (!rtisvalid(ro->ro_rt) || + if (ro->ro_rt && + (!(ro->ro_rt->rt_flags & RTF_UP) || sin6tosa(&ro->ro_dst)->sa_family != AF_INET6 || - !IN6_ARE_ADDR_EQUAL(&ro->ro_dst.sin6_addr, dst)) { + !IN6_ARE_ADDR_EQUAL(&ro->ro_dst.sin6_addr, dst))) { rtfree(ro->ro_rt); ro->ro_rt = NULL; } -- cgit v1.2.3