| version 1.102, 2007/04/22 19:47:41 |
version 1.103, 2007/05/02 20:40:27 |
|
|
| } |
} |
| } |
} |
| |
|
| extern struct route_in6 ip6_forward_rt; |
extern struct route ip6_forward_rt; |
| |
|
| void |
void |
| ip6_input(struct mbuf *m) |
ip6_input(struct mbuf *m) |
| Line 249 ip6_input(struct mbuf *m) |
|
| Line 249 ip6_input(struct mbuf *m) |
|
| int nxt, ours = 0; |
int nxt, ours = 0; |
| struct ifnet *deliverifp = NULL; |
struct ifnet *deliverifp = NULL; |
| int srcrt = 0; |
int srcrt = 0; |
| |
const struct sockaddr_in6 *cdst; |
| #ifdef FAST_IPSEC |
#ifdef FAST_IPSEC |
| struct m_tag *mtag; |
struct m_tag *mtag; |
| struct tdb_ident *tdbi; |
struct tdb_ident *tdbi; |
| Line 474 ip6_input(struct mbuf *m) |
|
| Line 475 ip6_input(struct mbuf *m) |
|
| goto hbhcheck; |
goto hbhcheck; |
| } |
} |
| |
|
| |
cdst = satocsin6(rtcache_getdst(&ip6_forward_rt)); |
| /* |
/* |
| * Unicast check |
* Unicast check |
| */ |
*/ |
| if (!IN6_ARE_ADDR_EQUAL(&ip6->ip6_dst, |
if (cdst == NULL) |
| &((const struct sockaddr_in6 *)rtcache_getdst((const struct route *)&ip6_forward_rt))->sin6_addr)) |
; |
| rtcache_free((struct route *)&ip6_forward_rt); |
else if (!IN6_ARE_ADDR_EQUAL(&ip6->ip6_dst, &cdst->sin6_addr)) |
| |
rtcache_free(&ip6_forward_rt); |
| else |
else |
| rtcache_check((struct route *)&ip6_forward_rt); |
rtcache_check(&ip6_forward_rt); |
| if (ip6_forward_rt.ro_rt != NULL) { |
if (ip6_forward_rt.ro_rt != NULL) { |
| /* XXX Revalidated route is accounted wrongly. */ |
/* XXX Revalidated route is accounted wrongly. */ |
| ip6stat.ip6s_forward_cachehit++; |
ip6stat.ip6s_forward_cachehit++; |
| } else { |
} else { |
| struct sockaddr_in6 *dst6; |
union { |
| |
struct sockaddr dst; |
| |
struct sockaddr_in6 dst6; |
| |
} u; |
| |
|
| ip6stat.ip6s_forward_cachemiss++; |
ip6stat.ip6s_forward_cachemiss++; |
| |
|
| dst6 = &ip6_forward_rt.ro_dst; |
sockaddr_in6_init(&u.dst6, &ip6->ip6_dst, 0, 0, 0); |
| memset(dst6, 0, sizeof(*dst6)); |
rtcache_setdst(&ip6_forward_rt, &u.dst); |
| dst6->sin6_len = sizeof(struct sockaddr_in6); |
|
| dst6->sin6_family = AF_INET6; |
|
| dst6->sin6_addr = ip6->ip6_dst; |
|
| |
|
| rtcache_init((struct route *)&ip6_forward_rt); |
rtcache_init(&ip6_forward_rt); |
| } |
} |
| |
|
| #define rt6_key(r) ((struct sockaddr_in6 *)((r)->rt_nodes->rn_key)) |
#define rt6_key(r) ((struct sockaddr_in6 *)((r)->rt_nodes->rn_key)) |