[BACK]Return to in6_gif.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/in6_gif.c between version 1.19 and 1.20

version 1.19, 2001/05/10 01:37:42 version 1.20, 2001/05/14 13:35:21
Line 150  in6_gif_output(ifp, family, m, rt)
Line 150  in6_gif_output(ifp, family, m, rt)
         ip6->ip6_nxt    = proto;          ip6->ip6_nxt    = proto;
         ip6->ip6_hlim   = ip6_gif_hlim;          ip6->ip6_hlim   = ip6_gif_hlim;
         ip6->ip6_src    = sin6_src->sin6_addr;          ip6->ip6_src    = sin6_src->sin6_addr;
         if (ifp->if_flags & IFF_LINK0) {          /* bidirectional configured tunnel mode */
                 /* multi-destination mode */          if (!IN6_IS_ADDR_UNSPECIFIED(&sin6_dst->sin6_addr))
                 if (!IN6_IS_ADDR_UNSPECIFIED(&sin6_dst->sin6_addr))                  ip6->ip6_dst = sin6_dst->sin6_addr;
                         ip6->ip6_dst = sin6_dst->sin6_addr;          else  {
                 else if (rt) {                  m_freem(m);
                         if (family != AF_INET6) {                  return ENETUNREACH;
                                 m_freem(m);  
                                 return EINVAL;  /*XXX*/  
                         }  
                         ip6->ip6_dst = ((struct sockaddr_in6 *)(rt->rt_gateway))->sin6_addr;  
                 } else {  
                         m_freem(m);  
                         return ENETUNREACH;  
                 }  
         } else {  
                 /* bidirectional configured tunnel mode */  
                 if (!IN6_IS_ADDR_UNSPECIFIED(&sin6_dst->sin6_addr))  
                         ip6->ip6_dst = sin6_dst->sin6_addr;  
                 else  {  
                         m_freem(m);  
                         return ENETUNREACH;  
                 }  
         }          }
         if (ifp->if_flags & IFF_LINK1)          if (ifp->if_flags & IFF_LINK1)
                 ip_ecn_ingress(ECN_ALLOWED, &otos, &itos);                  ip_ecn_ingress(ECN_ALLOWED, &otos, &itos);
Line 333  gif_encapcheck6(m, off, proto, arg)
Line 317  gif_encapcheck6(m, off, proto, arg)
                 addrmatch |= 1;                  addrmatch |= 1;
         if (IN6_ARE_ADDR_EQUAL(&dst->sin6_addr, &ip6.ip6_src))          if (IN6_ARE_ADDR_EQUAL(&dst->sin6_addr, &ip6.ip6_src))
                 addrmatch |= 2;                  addrmatch |= 2;
         else if ((sc->gif_if.if_flags & IFF_LINK0) != 0 &&  
                  IN6_IS_ADDR_UNSPECIFIED(&dst->sin6_addr)) {  
                 addrmatch |= 2; /* we accept any source */  
         }  
         if (addrmatch != 3)          if (addrmatch != 3)
                 return 0;                  return 0;
   
Line 367  gif_encapcheck6(m, off, proto, arg)
Line 347  gif_encapcheck6(m, off, proto, arg)
                 rtfree(rt);                  rtfree(rt);
         }          }
   
         /* prioritize: IFF_LINK0 mode is less preferred */          return 128 * 2;
         return (sc->gif_if.if_flags & IFF_LINK0) ? 128 : 128 * 2;  
 }  }

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.20

CVSweb <webmaster@jp.NetBSD.org>