[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.270 and 1.273

version 1.270, 2008/05/02 13:40:32 version 1.273, 2008/08/20 18:35:20
Line 420  ip_init(void)
Line 420  ip_init(void)
         ip_nmbclusters_changed();          ip_nmbclusters_changed();
   
         TAILQ_INIT(&in_ifaddrhead);          TAILQ_INIT(&in_ifaddrhead);
         in_ifaddrhashtbl = hashinit(IN_IFADDR_HASH_SIZE, HASH_LIST, M_IFADDR,          in_ifaddrhashtbl = hashinit(IN_IFADDR_HASH_SIZE, HASH_LIST, true,
             M_WAITOK, &in_ifaddrhash);              &in_ifaddrhash);
         in_multihashtbl = hashinit(IN_IFADDR_HASH_SIZE, HASH_LIST, M_IPMADDR,          in_multihashtbl = hashinit(IN_IFADDR_HASH_SIZE, HASH_LIST, true,
             M_WAITOK, &in_multihash);              &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(ip_hashsize);          ipflow_init(ip_hashsize);
Line 2143  sysctl_net_inet_ip_pmtudto(SYSCTLFN_ARGS
Line 2143  sysctl_net_inet_ip_pmtudto(SYSCTLFN_ARGS
         if (tmp < 0)          if (tmp < 0)
                 return (EINVAL);                  return (EINVAL);
   
           mutex_enter(softnet_lock);
   
         ip_mtudisc_timeout = tmp;          ip_mtudisc_timeout = tmp;
         rt_timer_queue_change(ip_mtudisc_timeout_q, ip_mtudisc_timeout);          rt_timer_queue_change(ip_mtudisc_timeout_q, ip_mtudisc_timeout);
   
           mutex_exit(softnet_lock);
   
         return (0);          return (0);
 }  }
   
Line 2156  sysctl_net_inet_ip_pmtudto(SYSCTLFN_ARGS
Line 2160  sysctl_net_inet_ip_pmtudto(SYSCTLFN_ARGS
 static int  static int
 sysctl_net_inet_ip_maxflows(SYSCTLFN_ARGS)  sysctl_net_inet_ip_maxflows(SYSCTLFN_ARGS)
 {  {
         int s;          int error;
   
         s = sysctl_lookup(SYSCTLFN_CALL(rnode));          error = sysctl_lookup(SYSCTLFN_CALL(rnode));
         if (s || newp == NULL)          if (error || newp == NULL)
                 return (s);                  return (error);
   
           mutex_enter(softnet_lock);
           KERNEL_LOCK(1, NULL);
   
         s = splsoftnet();  
         ipflow_prune();          ipflow_prune();
         splx(s);  
           KERNEL_UNLOCK_ONE(NULL);
           mutex_exit(softnet_lock);
   
         return (0);          return (0);
 }  }
Line 2186  sysctl_net_inet_ip_hashsize(SYSCTLFN_ARG
Line 2194  sysctl_net_inet_ip_hashsize(SYSCTLFN_ARG
                 /*                  /*
                  * Can only fail due to malloc()                   * Can only fail due to malloc()
                  */                   */
                 if (ipflow_invalidate_all(tmp))                  mutex_enter(softnet_lock);
                         return ENOMEM;                  KERNEL_LOCK(1, NULL);
   
                   error = ipflow_invalidate_all(tmp);
   
                   KERNEL_UNLOCK_ONE(NULL);
                   mutex_exit(softnet_lock);
   
         } else {          } else {
                 /*                  /*
                  * EINVAL if not a power of 2                   * EINVAL if not a power of 2
                  */                   */
                 return EINVAL;                  error = EINVAL;
         }          }
   
         return (0);          return error;
 }  }
 #endif /* GATEWAY */  #endif /* GATEWAY */
   
 static int  static int
 sysctl_net_inet_ip_stats(SYSCTLFN_ARGS)  sysctl_net_inet_ip_stats(SYSCTLFN_ARGS)
 {  {
         netstat_sysctl_context ctx;  
         uint64_t ips[IP_NSTATS];  
   
         ctx.ctx_stat = ipstat_percpu;          return (NETSTAT_SYSCTL(ipstat_percpu, IP_NSTATS));
         ctx.ctx_counters = ips;  
         ctx.ctx_ncounters = IP_NSTATS;  
         return (NETSTAT_SYSCTL(&ctx));  
 }  }
   
 SYSCTL_SETUP(sysctl_net_inet_ip_setup, "sysctl net.inet.ip subtree setup")  SYSCTL_SETUP(sysctl_net_inet_ip_setup, "sysctl net.inet.ip subtree setup")

Legend:
Removed from v.1.270  
changed lines
  Added in v.1.273

CVSweb <webmaster@jp.NetBSD.org>