[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.27 and 1.30

version 1.27, 1996/01/16 04:17:37 version 1.30, 1996/03/16 23:53:58
Line 45 
Line 45 
 #include <sys/errno.h>  #include <sys/errno.h>
 #include <sys/time.h>  #include <sys/time.h>
 #include <sys/kernel.h>  #include <sys/kernel.h>
   #include <sys/proc.h>
   
   #include <vm/vm.h>
   #include <sys/sysctl.h>
   
 #include <net/if.h>  #include <net/if.h>
 #include <net/route.h>  #include <net/route.h>
Line 199  next:
Line 203  next:
                 }                  }
                 ip = mtod(m, struct ip *);                  ip = mtod(m, struct ip *);
         }          }
         if (ip->ip_sum = in_cksum(m, hlen)) {          if ((ip->ip_sum = in_cksum(m, hlen)) != 0) {
                 ipstat.ips_badsum++;                  ipstat.ips_badsum++;
                 goto bad;                  goto bad;
         }          }
Line 712  ip_dooptions(m)
Line 716  ip_dooptions(m)
                         if (opt == IPOPT_SSRR) {                          if (opt == IPOPT_SSRR) {
 #define INA     struct in_ifaddr *  #define INA     struct in_ifaddr *
 #define SA      struct sockaddr *  #define SA      struct sockaddr *
                             if ((ia = (INA)ifa_ifwithdstaddr((SA)&ipaddr)) == 0)                              ia = (INA)ifa_ifwithladdr((SA)&ipaddr);
                                 ia = (INA)ifa_ifwithnet((SA)&ipaddr);  
                         } else                          } else
                                 ia = ip_rtaddr(ipaddr.sin_addr);                                  ia = ip_rtaddr(ipaddr.sin_addr);
                         if (ia == 0) {                          if (ia == 0) {
Line 911  ip_srcroute()
Line 914  ip_srcroute()
         *(mtod(m, struct in_addr *)) = *p--;          *(mtod(m, struct in_addr *)) = *p--;
 #ifdef DIAGNOSTIC  #ifdef DIAGNOSTIC
         if (ipprintfs)          if (ipprintfs)
                 printf(" hops %lx", ntohl(mtod(m, struct in_addr *)->s_addr));                  printf(" hops %x", ntohl(mtod(m, struct in_addr *)->s_addr));
 #endif  #endif
   
         /*          /*
Line 931  ip_srcroute()
Line 934  ip_srcroute()
         while (p >= ip_srcrt.route) {          while (p >= ip_srcrt.route) {
 #ifdef DIAGNOSTIC  #ifdef DIAGNOSTIC
                 if (ipprintfs)                  if (ipprintfs)
                         printf(" %lx", ntohl(q->s_addr));                          printf(" %x", ntohl(q->s_addr));
 #endif  #endif
                 *q++ = *p--;                  *q++ = *p--;
         }          }
Line 941  ip_srcroute()
Line 944  ip_srcroute()
         *q = ip_srcrt.dst;          *q = ip_srcrt.dst;
 #ifdef DIAGNOSTIC  #ifdef DIAGNOSTIC
         if (ipprintfs)          if (ipprintfs)
                 printf(" %lx\n", ntohl(q->s_addr));                  printf(" %x\n", ntohl(q->s_addr));
 #endif  #endif
         return (m);          return (m);
 }  }
Line 1004  ip_forward(m, srcrt)
Line 1007  ip_forward(m, srcrt)
         register struct ip *ip = mtod(m, struct ip *);          register struct ip *ip = mtod(m, struct ip *);
         register struct sockaddr_in *sin;          register struct sockaddr_in *sin;
         register struct rtentry *rt;          register struct rtentry *rt;
         int error, type = 0, code;          int error, type = 0, code = 0;
         struct mbuf *mcopy;          struct mbuf *mcopy;
         n_long dest;          n_long dest;
         struct ifnet *destifp;          struct ifnet *destifp;
Line 1012  ip_forward(m, srcrt)
Line 1015  ip_forward(m, srcrt)
         dest = 0;          dest = 0;
 #ifdef DIAGNOSTIC  #ifdef DIAGNOSTIC
         if (ipprintfs)          if (ipprintfs)
                 printf("forward: src %x dst %x ttl %x\n", ip->ip_src,                  printf("forward: src %x dst %x ttl %x\n",
                         ip->ip_dst, ip->ip_ttl);                         ip->ip_src.s_addr, ip->ip_dst.s_addr, ip->ip_ttl);
 #endif  #endif
         if (m->m_flags & M_BCAST || in_canforward(ip->ip_dst) == 0) {          if (m->m_flags & M_BCAST || in_canforward(ip->ip_dst) == 0) {
                 ipstat.ips_cantforward++;                  ipstat.ips_cantforward++;
Line 1076  ip_forward(m, srcrt)
Line 1079  ip_forward(m, srcrt)
                     code = ICMP_REDIRECT_HOST;                      code = ICMP_REDIRECT_HOST;
 #ifdef DIAGNOSTIC  #ifdef DIAGNOSTIC
                     if (ipprintfs)                      if (ipprintfs)
                         printf("redirect (%d) to %lx\n", code, (u_int32_t)dest);                          printf("redirect (%d) to %x\n", code, (u_int32_t)dest);
 #endif  #endif
                 }                  }
         }          }
Line 1139  ip_sysctl(name, namelen, oldp, oldlenp, 
Line 1142  ip_sysctl(name, namelen, oldp, oldlenp, 
         void *newp;          void *newp;
         size_t newlen;          size_t newlen;
 {  {
         int temp;  
   
         /* All sysctl names at this level are terminal. */          /* All sysctl names at this level are terminal. */
         if (namelen != 1)          if (namelen != 1)
                 return (ENOTDIR);                  return (ENOTDIR);

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.30

CVSweb <webmaster@jp.NetBSD.org>