| version 1.242.2.3, 2007/03/24 14:56:10 |
version 1.242.2.4, 2007/04/15 16:04:00 |
|
|
| 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 2177 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 2298 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, |