diff options
author | ume <ume@FreeBSD.org> | 2002-01-21 20:02:36 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2002-01-21 20:02:36 +0000 |
commit | ab65ed6b0b6ebf920fb25663dff5b1b6ea50c023 (patch) | |
tree | 2b0b452636986c47960bdfcad06db7ffcc4c58c3 | |
parent | 09d8de9092fd1738b39f3d6a0b2c4a13d1f0a09f (diff) | |
download | FreeBSD-src-ab65ed6b0b6ebf920fb25663dff5b1b6ea50c023.zip FreeBSD-src-ab65ed6b0b6ebf920fb25663dff5b1b6ea50c023.tar.gz |
- 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
-rw-r--r-- | sys/netinet6/in6_src.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/netinet6/in6_src.c b/sys/netinet6/in6_src.c index 3cee6cb..16a78ad 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; } |