From 54c1b8821b309912ac37b47d64e6c59a8594af3b Mon Sep 17 00:00:00 2001 From: Hajimu UMEMOTO Date: Mon, 21 Jan 2002 20:02:36 +0000 Subject: [PATCH] - Check the address family of a cached destination, in case of sharing the cache with IPv4. - Check if the cached route is up in in6_selectsrc(). Obtained from: KAME --- sys/netinet6/in6_src.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/netinet6/in6_src.c b/sys/netinet6/in6_src.c index 3cee6cb88f34..16a78adf0ddf 100644 --- a/sys/netinet6/in6_src.c +++ b/sys/netinet6/in6_src.c @@ -235,7 +235,10 @@ in6_selectsrc(dstsock, opts, mopts, ro, laddr, errorp) */ if (ro) { if (ro->ro_rt && - !IN6_ARE_ADDR_EQUAL(&satosin6(&ro->ro_dst)->sin6_addr, dst)) { + (!(ro->ro_rt->rt_flags & RTF_UP) || + satosin6(&ro->ro_dst)->sin6_family != AF_INET6 || + !IN6_ARE_ADDR_EQUAL(&satosin6(&ro->ro_dst)->sin6_addr, + dst))) { RTFREE(ro->ro_rt); ro->ro_rt = (struct rtentry *)0; }