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

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

Diff for /src/sys/netinet/ip_input.c between version 1.229.2.1 and 1.229.2.2

version 1.229.2.1, 2006/11/18 21:39:36 version 1.229.2.2, 2007/01/12 01:04:14
Line 461  ipintr(void)
Line 461  ipintr(void)
         int s;          int s;
         struct mbuf *m;          struct mbuf *m;
   
         while (1) {          while (!IF_IS_EMPTY(&ipintrq)) {
                 s = splnet();                  s = splnet();
                 IF_DEQUEUE(&ipintrq, m);                  IF_DEQUEUE(&ipintrq, m);
                 splx(s);                  splx(s);
Line 1679  ip_rtaddr(struct in_addr dst)
Line 1679  ip_rtaddr(struct in_addr dst)
   
         sin = satosin(&ipforward_rt.ro_dst);          sin = satosin(&ipforward_rt.ro_dst);
   
         if (ipforward_rt.ro_rt == 0 || !in_hosteq(dst, sin->sin_addr)) {          if (!in_hosteq(dst, sin->sin_addr))
                 if (ipforward_rt.ro_rt) {                  rtcache_free(&ipforward_rt);
                         RTFREE(ipforward_rt.ro_rt);          else
                         ipforward_rt.ro_rt = 0;                  rtcache_check(&ipforward_rt);
                 }          if (ipforward_rt.ro_rt == NULL) {
                 sin->sin_family = AF_INET;                  sin->sin_family = AF_INET;
                 sin->sin_len = sizeof(*sin);                  sin->sin_len = sizeof(*sin);
                 sin->sin_addr = dst;                  sin->sin_addr = dst;
   
                 rtalloc(&ipforward_rt);                  rtcache_init(&ipforward_rt);
                   if (ipforward_rt.ro_rt == NULL)
                           return NULL;
         }          }
         if (ipforward_rt.ro_rt == 0)  
                 return ((struct in_ifaddr *)0);  
         return (ifatoia(ipforward_rt.ro_rt->rt_ifa));          return (ifatoia(ipforward_rt.ro_rt->rt_ifa));
 }  }
   
Line 1728  ip_srcroute(void)
Line 1728  ip_srcroute(void)
         struct mbuf *m;          struct mbuf *m;
   
         if (ip_nhops == 0)          if (ip_nhops == 0)
                 return ((struct mbuf *)0);                  return NULL;
         m = m_get(M_DONTWAIT, MT_SOOPTS);          m = m_get(M_DONTWAIT, MT_SOOPTS);
         if (m == 0)          if (m == 0)
                 return ((struct mbuf *)0);                  return NULL;
   
         MCLAIM(m, &inetdomain.dom_mowner);          MCLAIM(m, &inetdomain.dom_mowner);
 #define OPTSIZ  (sizeof(ip_srcrt.nop) + sizeof(ip_srcrt.srcopt))  #define OPTSIZ  (sizeof(ip_srcrt.nop) + sizeof(ip_srcrt.srcopt))
Line 1873  ip_forward(struct mbuf *m, int srcrt)
Line 1873  ip_forward(struct mbuf *m, int srcrt)
         }          }
   
         sin = satosin(&ipforward_rt.ro_dst);          sin = satosin(&ipforward_rt.ro_dst);
         if ((rt = ipforward_rt.ro_rt) == 0 ||          if (!in_hosteq(ip->ip_dst, sin->sin_addr))
             !in_hosteq(ip->ip_dst, sin->sin_addr)) {                  rtcache_free(&ipforward_rt);
                 if (ipforward_rt.ro_rt) {          else
                         RTFREE(ipforward_rt.ro_rt);                  rtcache_check(&ipforward_rt);
                         ipforward_rt.ro_rt = 0;          if (ipforward_rt.ro_rt == NULL) {
                 }  
                 sin->sin_family = AF_INET;                  sin->sin_family = AF_INET;
                 sin->sin_len = sizeof(struct sockaddr_in);                  sin->sin_len = sizeof(struct sockaddr_in);
                 sin->sin_addr = ip->ip_dst;                  sin->sin_addr = ip->ip_dst;
   
                 rtalloc(&ipforward_rt);                  rtcache_init(&ipforward_rt);
                 if (ipforward_rt.ro_rt == 0) {                  if (ipforward_rt.ro_rt == NULL) {
                         icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_NET, dest, 0);                          icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_NET, dest, 0);
                         return;                          return;
                 }                  }
                 rt = ipforward_rt.ro_rt;  
         }          }
           rt = ipforward_rt.ro_rt;
   
         /*          /*
          * Save at most 68 bytes of the packet in case           * Save at most 68 bytes of the packet in case
Line 1935  ip_forward(struct mbuf *m, int srcrt)
Line 1934  ip_forward(struct mbuf *m, int srcrt)
                 }                  }
         }          }
   
         error = ip_output(m, (struct mbuf *)0, &ipforward_rt,          error = ip_output(m, NULL, &ipforward_rt,
             (IP_FORWARDING | (ip_directedbcast ? IP_ALLOWBROADCAST : 0)),              (IP_FORWARDING | (ip_directedbcast ? IP_ALLOWBROADCAST : 0)),
             (struct ip_moptions *)NULL, (struct socket *)NULL);              (struct ip_moptions *)NULL, (struct socket *)NULL);
   
Line 1978  ip_forward(struct mbuf *m, int srcrt)
Line 1977  ip_forward(struct mbuf *m, int srcrt)
                 type = ICMP_UNREACH;                  type = ICMP_UNREACH;
                 code = ICMP_UNREACH_NEEDFRAG;                  code = ICMP_UNREACH_NEEDFRAG;
 #if !defined(IPSEC) && !defined(FAST_IPSEC)  #if !defined(IPSEC) && !defined(FAST_IPSEC)
                 if (ipforward_rt.ro_rt)                  if (ipforward_rt.ro_rt != NULL)
                         destmtu = ipforward_rt.ro_rt->rt_ifp->if_mtu;                          destmtu = ipforward_rt.ro_rt->rt_ifp->if_mtu;
 #else  #else
                 /*                  /*
Line 1987  ip_forward(struct mbuf *m, int srcrt)
Line 1986  ip_forward(struct mbuf *m, int srcrt)
                  *      tunnel MTU = if MTU - sizeof(IP) - ESP/AH hdrsiz                   *      tunnel MTU = if MTU - sizeof(IP) - ESP/AH hdrsiz
                  * XXX quickhack!!!                   * XXX quickhack!!!
                  */                   */
                 if (ipforward_rt.ro_rt) {                  if (ipforward_rt.ro_rt != NULL) {
                         struct secpolicy *sp;                          struct secpolicy *sp;
                         int ipsecerror;                          int ipsecerror;
                         size_t ipsechdr;                          size_t ipsechdr;

Legend:
Removed from v.1.229.2.1  
changed lines
  Added in v.1.229.2.2

CVSweb <webmaster@jp.NetBSD.org>