[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.218.2.3 and 1.229.2.2

version 1.218.2.3, 2007/02/26 09:11:44 version 1.229.2.2, 2007/01/12 01:04:14
Line 1675  bad:
Line 1675  bad:
 struct in_ifaddr *  struct in_ifaddr *
 ip_rtaddr(struct in_addr dst)  ip_rtaddr(struct in_addr dst)
 {  {
         if (!in_hosteq(dst, satocsin(rtcache_getdst(&ipforward_rt))->sin_addr))          struct sockaddr_in *sin;
   
           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 1691  ip_rtaddr(struct in_addr dst)
Line 1692  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 1838  void
Line 1839  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 1870  ip_forward(struct mbuf *m, int srcrt)
Line 1872  ip_forward(struct mbuf *m, int srcrt)
                 return;                  return;
         }          }
   
         if (!in_hosteq(ip->ip_dst,          sin = satosin(&ipforward_rt.ro_dst);
                        satocsin(rtcache_getdst(&ipforward_rt))->sin_addr))          if (!in_hosteq(ip->ip_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(struct sockaddr_in);
                 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.218.2.3  
changed lines
  Added in v.1.229.2.2

CVSweb <webmaster@jp.NetBSD.org>