| version 1.88.8.1, 2006/10/22 06:07:35 |
version 1.88.8.2, 2006/12/10 07:19:15 |
|
|
| } |
} |
| |
|
| static void |
static void |
| ip6_init2(void *dummy __unused) |
ip6_init2(void *dummy) |
| { |
{ |
| |
|
| /* nd6_timer_init */ |
/* nd6_timer_init */ |
|
|
| else { |
else { |
| struct sockaddr_in6 *dst6; |
struct sockaddr_in6 *dst6; |
| |
|
| if (ip6_forward_rt.ro_rt) { |
if (ip6_forward_rt.ro_rt != NULL) { |
| /* route is down or destination is different */ |
/* route is down or destination is different */ |
| ip6stat.ip6s_forward_cachemiss++; |
ip6stat.ip6s_forward_cachemiss++; |
| RTFREE(ip6_forward_rt.ro_rt); |
rtflush((struct route *)&ip6_forward_rt); |
| ip6_forward_rt.ro_rt = 0; |
|
| } |
} |
| |
|
| bzero(&ip6_forward_rt.ro_dst, sizeof(struct sockaddr_in6)); |
bzero(&ip6_forward_rt.ro_dst, sizeof(struct sockaddr_in6)); |
|
|
| * But we think it's even useful in some situations, e.g. when using |
* But we think it's even useful in some situations, e.g. when using |
| * a special daemon which wants to intercept the packet. |
* a special daemon which wants to intercept the packet. |
| */ |
*/ |
| if (ip6_forward_rt.ro_rt && |
if (ip6_forward_rt.ro_rt != NULL && |
| (ip6_forward_rt.ro_rt->rt_flags & |
(ip6_forward_rt.ro_rt->rt_flags & |
| (RTF_HOST|RTF_GATEWAY)) == RTF_HOST && |
(RTF_HOST|RTF_GATEWAY)) == RTF_HOST && |
| !(ip6_forward_rt.ro_rt->rt_flags & RTF_CLONED) && |
!(ip6_forward_rt.ro_rt->rt_flags & RTF_CLONED) && |
|
|
| */ |
*/ |
| #if defined(NFAITH) && 0 < NFAITH |
#if defined(NFAITH) && 0 < NFAITH |
| if (ip6_keepfaith) { |
if (ip6_keepfaith) { |
| if (ip6_forward_rt.ro_rt && ip6_forward_rt.ro_rt->rt_ifp && |
if (ip6_forward_rt.ro_rt != NULL && |
| |
ip6_forward_rt.ro_rt->rt_ifp != NULL && |
| ip6_forward_rt.ro_rt->rt_ifp->if_type == IFT_FAITH) { |
ip6_forward_rt.ro_rt->rt_ifp->if_type == IFT_FAITH) { |
| /* XXX do we need more sanity checks? */ |
/* XXX do we need more sanity checks? */ |
| ours = 1; |
ours = 1; |
|
|
| * working right. |
* working right. |
| */ |
*/ |
| struct ifaddr *ifa; |
struct ifaddr *ifa; |
| for (ifa = m->m_pkthdr.rcvif->if_addrlist.tqh_first; |
TAILQ_FOREACH(ifa, &m->m_pkthdr.rcvif->if_addrlist, ifa_list) { |
| ifa; |
|
| ifa = ifa->ifa_list.tqe_next) { |
|
| if (ifa->ifa_addr == NULL) |
if (ifa->ifa_addr == NULL) |
| continue; /* just for safety */ |
continue; /* just for safety */ |
| if (ifa->ifa_addr->sa_family != AF_INET6) |
if (ifa->ifa_addr->sa_family != AF_INET6) |