[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.2 and 1.243

version 1.229.2.2, 2007/01/12 01:04:14 version 1.243, 2007/02/17 22:34:11
Line 1675  bad:
Line 1675  bad:
 struct in_ifaddr *  struct in_ifaddr *
 ip_rtaddr(struct in_addr dst)  ip_rtaddr(struct in_addr dst)
 {  {
         struct sockaddr_in *sin;          if (!in_hosteq(dst, satocsin(rtcache_getdst(&ipforward_rt))->sin_addr))
   
         sin = satosin(&ipforward_rt.ro_dst);  
   
         if (!in_hosteq(dst, sin->sin_addr))  
                 rtcache_free(&ipforward_rt);                  rtcache_free(&ipforward_rt);
         else          else
                 rtcache_check(&ipforward_rt);                  rtcache_check(&ipforward_rt);
   
         if (ipforward_rt.ro_rt == NULL) {          if (ipforward_rt.ro_rt == NULL) {
                   struct sockaddr_in *sin = satosin(&ipforward_rt.ro_dst);
   
                 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;
Line 1692  ip_rtaddr(struct in_addr dst)
Line 1691  ip_rtaddr(struct in_addr dst)
                 if (ipforward_rt.ro_rt == NULL)                  if (ipforward_rt.ro_rt == NULL)
                         return NULL;                          return NULL;
         }          }
         return (ifatoia(ipforward_rt.ro_rt->rt_ifa));          return ifatoia(ipforward_rt.ro_rt->rt_ifa);
 }  }
   
 /*  /*
Line 1839  void
Line 1838  void
 ip_forward(struct mbuf *m, int srcrt)  ip_forward(struct mbuf *m, int srcrt)
 {  {
         struct ip *ip = mtod(m, struct ip *);          struct ip *ip = mtod(m, struct ip *);
         struct sockaddr_in *sin;  
         struct rtentry *rt;          struct rtentry *rt;
         int error, type = 0, code = 0, destmtu = 0;          int error, type = 0, code = 0, destmtu = 0;
         struct mbuf *mcopy;          struct mbuf *mcopy;
Line 1872  ip_forward(struct mbuf *m, int srcrt)
Line 1870  ip_forward(struct mbuf *m, int srcrt)
                 return;                  return;
         }          }
   
         sin = satosin(&ipforward_rt.ro_dst);          if (!in_hosteq(ip->ip_dst,
         if (!in_hosteq(ip->ip_dst, sin->sin_addr))                         satocsin(rtcache_getdst(&ipforward_rt))->sin_addr))
                 rtcache_free(&ipforward_rt);                  rtcache_free(&ipforward_rt);
         else          else
                 rtcache_check(&ipforward_rt);                  rtcache_check(&ipforward_rt);
         if (ipforward_rt.ro_rt == NULL) {          if (ipforward_rt.ro_rt == NULL) {
                   struct sockaddr_in *sin = satosin(&ipforward_rt.ro_dst);
   
                 sin->sin_family = AF_INET;                  sin->sin_family = AF_INET;
                 sin->sin_len = sizeof(struct sockaddr_in);                  sin->sin_len = sizeof(*sin);
                 sin->sin_addr = ip->ip_dst;                  sin->sin_addr = ip->ip_dst;
   
                 rtcache_init(&ipforward_rt);                  rtcache_init(&ipforward_rt);

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

CVSweb <webmaster@jp.NetBSD.org>