[BACK]Return to ip6_input.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / netinet6

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/netinet6/ip6_input.c between version 1.88.8.3 and 1.89

version 1.88.8.3, 2006/12/18 11:42:23 version 1.89, 2006/10/12 01:32:39
Line 189  ip6_init()
Line 189  ip6_init()
 }  }
   
 static void  static void
 ip6_init2(void *dummy)  ip6_init2(void *dummy __unused)
 {  {
   
         /* nd6_timer_init */          /* nd6_timer_init */
Line 450  ip6_input(m)
Line 450  ip6_input(m)
         /*          /*
          *  Unicast check           *  Unicast check
          */           */
         if (!IN6_ARE_ADDR_EQUAL(&ip6->ip6_dst,          if (ip6_forward_rt.ro_rt != NULL &&
               (ip6_forward_rt.ro_rt->rt_flags & RTF_UP) != 0 &&
               IN6_ARE_ADDR_EQUAL(&ip6->ip6_dst,
             &((struct sockaddr_in6 *)(&ip6_forward_rt.ro_dst))->sin6_addr))              &((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++;                  ip6stat.ip6s_forward_cachehit++;
         } else {          else {
                 struct sockaddr_in6 *dst6;                  struct sockaddr_in6 *dst6;
   
                 ip6stat.ip6s_forward_cachemiss++;                  if (ip6_forward_rt.ro_rt) {
                           /* route is down or destination is different */
                           ip6stat.ip6s_forward_cachemiss++;
                           RTFREE(ip6_forward_rt.ro_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));
                 dst6 = (struct sockaddr_in6 *)&ip6_forward_rt.ro_dst;                  dst6 = (struct sockaddr_in6 *)&ip6_forward_rt.ro_dst;
Line 469  ip6_input(m)
Line 471  ip6_input(m)
                 dst6->sin6_family = AF_INET6;                  dst6->sin6_family = AF_INET6;
                 dst6->sin6_addr = ip6->ip6_dst;                  dst6->sin6_addr = ip6->ip6_dst;
   
                 rtcache_init((struct route *)&ip6_forward_rt);                  rtalloc((struct route *)&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))
Line 483  ip6_input(m)
Line 485  ip6_input(m)
          * 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 != NULL &&          if (ip6_forward_rt.ro_rt &&
             (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) &&
Line 526  ip6_input(m)
Line 528  ip6_input(m)
          */           */
 #if defined(NFAITH) && 0 < NFAITH  #if defined(NFAITH) && 0 < NFAITH
         if (ip6_keepfaith) {          if (ip6_keepfaith) {
                 if (ip6_forward_rt.ro_rt != NULL &&                  if (ip6_forward_rt.ro_rt && ip6_forward_rt.ro_rt->rt_ifp &&
                     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;
Line 545  ip6_input(m)
Line 546  ip6_input(m)
          * working right.           * working right.
          */           */
         struct ifaddr *ifa;          struct ifaddr *ifa;
         TAILQ_FOREACH(ifa, &m->m_pkthdr.rcvif->if_addrlist, ifa_list) {          for (ifa = m->m_pkthdr.rcvif->if_addrlist.tqh_first;
                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)

Legend:
Removed from v.1.88.8.3  
changed lines
  Added in v.1.89

CVSweb <webmaster@jp.NetBSD.org>