- 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
This commit is contained in:
Hajimu UMEMOTO 2002-01-21 20:02:36 +00:00
parent f650a12484
commit 54c1b8821b

View File

@ -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;
}