[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.246 and 1.246.4.1

version 1.246, 2007/03/12 18:18:36 version 1.246.4.1, 2007/03/29 19:28:00
Line 429  ip_init(void)
Line 429  ip_init(void)
             M_WAITOK, &in_multihash);              M_WAITOK, &in_multihash);
         ip_mtudisc_timeout_q = rt_timer_queue_create(ip_mtudisc_timeout);          ip_mtudisc_timeout_q = rt_timer_queue_create(ip_mtudisc_timeout);
 #ifdef GATEWAY  #ifdef GATEWAY
         ipflow_init();          ipflow_init(ip_hashsize);
 #endif  #endif
   
 #ifdef PFIL_HOOKS  #ifdef PFIL_HOOKS
Line 2160  sysctl_net_inet_ip_pmtudto(SYSCTLFN_ARGS
Line 2160  sysctl_net_inet_ip_pmtudto(SYSCTLFN_ARGS
   
 #ifdef GATEWAY  #ifdef GATEWAY
 /*  /*
  * sysctl helper routine for net.inet.ip.maxflows.  apparently if   * sysctl helper routine for net.inet.ip.maxflows.
  * maxflows is even looked up, we "reap flows".  
  */   */
 static int  static int
 sysctl_net_inet_ip_maxflows(SYSCTLFN_ARGS)  sysctl_net_inet_ip_maxflows(SYSCTLFN_ARGS)
Line 2169  sysctl_net_inet_ip_maxflows(SYSCTLFN_ARG
Line 2168  sysctl_net_inet_ip_maxflows(SYSCTLFN_ARG
         int s;          int s;
   
         s = sysctl_lookup(SYSCTLFN_CALL(rnode));          s = sysctl_lookup(SYSCTLFN_CALL(rnode));
         if (s)          if (s || newp == NULL)
                 return (s);                  return (s);
   
         s = splsoftnet();          s = splsoftnet();
Line 2178  sysctl_net_inet_ip_maxflows(SYSCTLFN_ARG
Line 2177  sysctl_net_inet_ip_maxflows(SYSCTLFN_ARG
   
         return (0);          return (0);
 }  }
   
   static int
   sysctl_net_inet_ip_hashsize(SYSCTLFN_ARGS)
   {
           int error, tmp;
           struct sysctlnode node;
   
           node = *rnode;
           tmp = ip_hashsize;
           node.sysctl_data = &tmp;
           error = sysctl_lookup(SYSCTLFN_CALL(&node));
           if (error || newp == NULL)
                   return (error);
   
           if ((tmp & (tmp - 1)) == 0 && tmp != 0) {
                   /*
                    * Can only fail due to malloc()
                    */
                   if (ipflow_invalidate_all(tmp))
                           return ENOMEM;
           } else {
                   /*
                    * EINVAL if not a power of 2
                    */
                   return EINVAL;
           }
   
           return (0);
   }
 #endif /* GATEWAY */  #endif /* GATEWAY */
   
   
Line 2299  SYSCTL_SETUP(sysctl_net_inet_ip_setup, "
Line 2327  SYSCTL_SETUP(sysctl_net_inet_ip_setup, "
                        sysctl_net_inet_ip_maxflows, 0, &ip_maxflows, 0,                         sysctl_net_inet_ip_maxflows, 0, &ip_maxflows, 0,
                        CTL_NET, PF_INET, IPPROTO_IP,                         CTL_NET, PF_INET, IPPROTO_IP,
                        IPCTL_MAXFLOWS, CTL_EOL);                         IPCTL_MAXFLOWS, CTL_EOL);
           sysctl_createv(clog, 0, NULL, NULL,
                           CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
                           CTLTYPE_INT, "hashsize",
                           SYSCTL_DESCR("Size of hash table for fast forwarding (IPv4)"),
                           sysctl_net_inet_ip_hashsize, 0, &ip_hashsize, 0,
                           CTL_NET, PF_INET, IPPROTO_IP,
                           CTL_CREATE, CTL_EOL);
 #endif /* GATEWAY */  #endif /* GATEWAY */
         sysctl_createv(clog, 0, NULL, NULL,          sysctl_createv(clog, 0, NULL, NULL,
                        CTLFLAG_PERMANENT|CTLFLAG_READWRITE,                         CTLFLAG_PERMANENT|CTLFLAG_READWRITE,

Legend:
Removed from v.1.246  
changed lines
  Added in v.1.246.4.1

CVSweb <webmaster@jp.NetBSD.org>