[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.53.2.2 and 1.54

version 1.53.2.2, 1998/07/22 23:50:10 version 1.54, 1998/01/05 09:52:04
Line 86 
Line 86 
 #ifndef IPMTUDISC  #ifndef IPMTUDISC
 #define IPMTUDISC       0  #define IPMTUDISC       0
 #endif  #endif
 #ifndef IPMTUDISCTIMEOUT  
 #define IPMTUDISCTIMEOUT (10 * 60)      /* as per RFC 1191 */  
 #endif  
   
   
 /*  /*
  * Note: DIRECTED_BROADCAST is handled this way so that previous   * Note: DIRECTED_BROADCAST is handled this way so that previous
Line 109  int ip_forwsrcrt = IPFORWSRCRT;
Line 105  int ip_forwsrcrt = IPFORWSRCRT;
 int     ip_directedbcast = IPDIRECTEDBCAST;  int     ip_directedbcast = IPDIRECTEDBCAST;
 int     ip_allowsrcrt = IPALLOWSRCRT;  int     ip_allowsrcrt = IPALLOWSRCRT;
 int     ip_mtudisc = IPMTUDISC;  int     ip_mtudisc = IPMTUDISC;
 u_int   ip_mtudisc_timeout = IPMTUDISCTIMEOUT;  
 #ifdef DIAGNOSTIC  #ifdef DIAGNOSTIC
 int     ipprintfs = 0;  int     ipprintfs = 0;
 #endif  #endif
   
 struct rttimer_queue *ip_mtudisc_timeout_q = NULL;  
   
 extern  struct domain inetdomain;  extern  struct domain inetdomain;
 extern  struct protosw inetsw[];  extern  struct protosw inetsw[];
 u_char  ip_protox[IPPROTO_MAX];  u_char  ip_protox[IPPROTO_MAX];
Line 164  ip_init()
Line 157  ip_init()
         ip_id = time.tv_sec & 0xffff;          ip_id = time.tv_sec & 0xffff;
         ipintrq.ifq_maxlen = ipqmaxlen;          ipintrq.ifq_maxlen = ipqmaxlen;
         TAILQ_INIT(&in_ifaddr);          TAILQ_INIT(&in_ifaddr);
   
         if (ip_mtudisc != 0)  
                 ip_mtudisc_timeout_q =  
                     rt_timer_queue_create(ip_mtudisc_timeout);  
 }  }
   
 struct  sockaddr_in ipaddr = { sizeof(ipaddr), AF_INET };  struct  sockaddr_in ipaddr = { sizeof(ipaddr), AF_INET };
Line 271  next:
Line 260  next:
          * Run through list of hooks for input packets.           * Run through list of hooks for input packets.
          */           */
         m0 = m;          m0 = m;
         for (pfh = pfil_hook_get(PFIL_IN); pfh; pfh = pfh->pfil_link.tqe_next)          for (pfh = pfil_hook_get(PFIL_IN); pfh; pfh = pfh->pfil_link.le_next)
                 if (pfh->pfil_func) {                  if (pfh->pfil_func) {
                         rv = pfh->pfil_func(ip, hlen, m->m_pkthdr.rcvif, 0, &m0);                          rv = pfh->pfil_func(ip, hlen, m->m_pkthdr.rcvif, 0, &m0);
                         if (rv)                          if (rv)
                                 goto next;                                  goto next;
                         m = m0;                          ip = mtod(m = m0, struct ip *);
                         if (m == NULL)  
                                 goto next;  
                         ip = mtod(m, struct ip *);  
                 }                  }
 #endif /* PFIL_HOOKS */  #endif /* PFIL_HOOKS */
   
Line 1262  ip_sysctl(name, namelen, oldp, oldlenp, 
Line 1248  ip_sysctl(name, namelen, oldp, oldlenp, 
         size_t newlen;          size_t newlen;
 {  {
         extern int subnetsarelocal;          extern int subnetsarelocal;
         int error;  
           int error, old;
   
         /* All sysctl names at this level are terminal. */          /* All sysctl names at this level are terminal. */
         if (namelen != 1)          if (namelen != 1)
Line 1298  ip_sysctl(name, namelen, oldp, oldlenp, 
Line 1285  ip_sysctl(name, namelen, oldp, oldlenp, 
                 return (sysctl_int(oldp, oldlenp, newp, newlen,                  return (sysctl_int(oldp, oldlenp, newp, newlen,
                     &subnetsarelocal));                      &subnetsarelocal));
         case IPCTL_MTUDISC:          case IPCTL_MTUDISC:
                 error = sysctl_int(oldp, oldlenp, newp, newlen,                  return (sysctl_int(oldp, oldlenp, newp, newlen,
                     &ip_mtudisc);                      &ip_mtudisc));
                 if (ip_mtudisc != 0 && ip_mtudisc_timeout_q == NULL) {          case IPCTL_ANONPORTMIN:
                         ip_mtudisc_timeout_q =                  old = anonportmin;
                             rt_timer_queue_create(ip_mtudisc_timeout);                  error = sysctl_int(oldp, oldlenp, newp, newlen, &anonportmin);
                 } else if (ip_mtudisc == 0 && ip_mtudisc_timeout_q != NULL) {                  if (anonportmin >= anonportmax || anonportmin > 65535
                         rt_timer_queue_destroy(ip_mtudisc_timeout_q, TRUE);  #ifndef IPNOPRIVPORTS
                         ip_mtudisc_timeout_q = NULL;                      || anonportmin < IPPORT_RESERVED
   #endif
                       ) {
                           anonportmin = old;
                           return (EINVAL);
                   }
                   return (error);
           case IPCTL_ANONPORTMAX:
                   old = anonportmax;
                   error = sysctl_int(oldp, oldlenp, newp, newlen, &anonportmax);
                   if (anonportmin >= anonportmax || anonportmax > 65535
   #ifndef IPNOPRIVPORTS
                       || anonportmax < IPPORT_RESERVED
   #endif
                       ) {
                           anonportmax = old;
                           return (EINVAL);
                 }                  }
                 return error;                  return (error);
         case IPCTL_MTUDISCTIMEOUT:  
                 error = sysctl_int(oldp, oldlenp, newp, newlen,  
                    &ip_mtudisc_timeout);  
                 if (ip_mtudisc_timeout_q != NULL)  
                         rt_timer_queue_change(ip_mtudisc_timeout_q,  
                                               ip_mtudisc_timeout);  
                 return (error);  
         default:          default:
                 return (EOPNOTSUPP);                  return (EOPNOTSUPP);
         }          }

Legend:
Removed from v.1.53.2.2  
changed lines
  Added in v.1.54

CVSweb <webmaster@jp.NetBSD.org>