Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/netinet6/ip6_input.c,v retrieving revision 1.92 retrieving revision 1.93 diff -u -p -r1.92 -r1.93 --- src/sys/netinet6/ip6_input.c 2006/12/09 05:33:08 1.92 +++ src/sys/netinet6/ip6_input.c 2006/12/15 21:18:55 1.93 @@ -1,4 +1,4 @@ -/* $NetBSD: ip6_input.c,v 1.92 2006/12/09 05:33:08 dyoung Exp $ */ +/* $NetBSD: ip6_input.c,v 1.93 2006/12/15 21:18:55 joerg Exp $ */ /* $KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $ */ /* @@ -62,7 +62,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ip6_input.c,v 1.92 2006/12/09 05:33:08 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ip6_input.c,v 1.93 2006/12/15 21:18:55 joerg Exp $"); #include "opt_inet.h" #include "opt_inet6.h" @@ -450,19 +450,18 @@ ip6_input(m) /* * Unicast check */ - if (ip6_forward_rt.ro_rt != NULL && - (ip6_forward_rt.ro_rt->rt_flags & RTF_UP) != 0 && - IN6_ARE_ADDR_EQUAL(&ip6->ip6_dst, + if (!IN6_ARE_ADDR_EQUAL(&ip6->ip6_dst, &((struct sockaddr_in6 *)(&ip6_forward_rt.ro_dst))->sin6_addr)) + rtcache_free((struct route *)&ip6_forward_rt); + else + rtcache_check((struct route *)&ip6_forward_rt); + if (ip6_forward_rt.ro_rt != NULL) { + /* XXX Revalidated route is accounted wrongly. */ ip6stat.ip6s_forward_cachehit++; - else { + } else { struct sockaddr_in6 *dst6; - if (ip6_forward_rt.ro_rt != NULL) { - /* route is down or destination is different */ - ip6stat.ip6s_forward_cachemiss++; - rtflush((struct route *)&ip6_forward_rt); - } + ip6stat.ip6s_forward_cachemiss++; bzero(&ip6_forward_rt.ro_dst, sizeof(struct sockaddr_in6)); dst6 = (struct sockaddr_in6 *)&ip6_forward_rt.ro_dst; @@ -470,7 +469,7 @@ ip6_input(m) dst6->sin6_family = AF_INET6; dst6->sin6_addr = ip6->ip6_dst; - rtalloc((struct route *)&ip6_forward_rt); + rtcache_init((struct route *)&ip6_forward_rt); } #define rt6_key(r) ((struct sockaddr_in6 *)((r)->rt_nodes->rn_key))