version 1.113.12.3, 2008/09/28 10:40:59 |
version 1.117, 2008/04/23 06:09:05 |
Line 206 ip6_init2(void *dummy) |
|
Line 206 ip6_init2(void *dummy) |
|
{ |
{ |
|
|
/* nd6_timer_init */ |
/* nd6_timer_init */ |
callout_init(&nd6_timer_ch, CALLOUT_MPSAFE); |
callout_init(&nd6_timer_ch, 0); |
callout_reset(&nd6_timer_ch, hz, nd6_timer, NULL); |
callout_reset(&nd6_timer_ch, hz, nd6_timer, NULL); |
|
|
/* timer for regeneranation of temporary addresses randomize ID */ |
/* timer for regeneranation of temporary addresses randomize ID */ |
callout_init(&in6_tmpaddrtimer_ch, CALLOUT_MPSAFE); |
callout_init(&in6_tmpaddrtimer_ch, 0); |
callout_reset(&in6_tmpaddrtimer_ch, |
callout_reset(&in6_tmpaddrtimer_ch, |
(ip6_temp_preferred_lifetime - ip6_desync_factor - |
(ip6_temp_preferred_lifetime - ip6_desync_factor - |
ip6_temp_regen_advance) * hz, |
ip6_temp_regen_advance) * hz, |
|
|
int s; |
int s; |
struct mbuf *m; |
struct mbuf *m; |
|
|
mutex_enter(softnet_lock); |
|
KERNEL_LOCK(1, NULL); |
|
for (;;) { |
for (;;) { |
s = splnet(); |
s = splnet(); |
IF_DEQUEUE(&ip6intrq, m); |
IF_DEQUEUE(&ip6intrq, m); |
splx(s); |
splx(s); |
if (m == 0) |
if (m == 0) |
break; |
return; |
/* drop the packet if IPv6 operation is disabled on the IF */ |
/* drop the packet if IPv6 operation is disabled on the IF */ |
if ((ND_IFINFO(m->m_pkthdr.rcvif)->flags & ND6_IFF_IFDISABLED)) { |
if ((ND_IFINFO(m->m_pkthdr.rcvif)->flags & ND6_IFF_IFDISABLED)) { |
m_freem(m); |
m_freem(m); |
break; |
return; |
} |
} |
ip6_input(m); |
ip6_input(m); |
} |
} |
KERNEL_UNLOCK_ONE(NULL); |
|
mutex_exit(softnet_lock); |
|
} |
} |
|
|
extern struct route ip6_forward_rt; |
extern struct route ip6_forward_rt; |
Line 1595 ip6_delaux(struct mbuf *m) |
|
Line 1591 ip6_delaux(struct mbuf *m) |
|
static int |
static int |
sysctl_net_inet6_ip6_maxflows(SYSCTLFN_ARGS) |
sysctl_net_inet6_ip6_maxflows(SYSCTLFN_ARGS) |
{ |
{ |
int error; |
int s; |
|
|
error = sysctl_lookup(SYSCTLFN_CALL(rnode)); |
s = sysctl_lookup(SYSCTLFN_CALL(rnode)); |
if (error || newp == NULL) |
if (s || newp == NULL) |
return (error); |
return (s); |
|
|
mutex_enter(softnet_lock); |
s = splsoftnet(); |
KERNEL_LOCK(1, NULL); |
ip6flow_reap(0); |
|
splx(s); |
ip6flow_reap(0); |
|
|
|
KERNEL_UNLOCK_ONE(NULL); |
|
mutex_exit(softnet_lock); |
|
|
|
return (0); |
return (0); |
} |
} |
|
|
static int |
static int |
Line 1629 sysctl_net_inet6_ip6_hashsize(SYSCTLFN_A |
|
Line 1621 sysctl_net_inet6_ip6_hashsize(SYSCTLFN_A |
|
/* |
/* |
* Can only fail due to malloc() |
* Can only fail due to malloc() |
*/ |
*/ |
mutex_enter(softnet_lock); |
if (ip6flow_invalidate_all(tmp)) |
KERNEL_LOCK(1, NULL); |
return ENOMEM; |
|
|
error = ip6flow_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 |
*/ |
*/ |
error = EINVAL; |
return EINVAL; |
} |
} |
|
|
return error; |
return (0); |
} |
} |
#endif /* GATEWAY */ |
#endif /* GATEWAY */ |
|
|
Line 1651 sysctl_net_inet6_ip6_hashsize(SYSCTLFN_A |
|
Line 1638 sysctl_net_inet6_ip6_hashsize(SYSCTLFN_A |
|
* System control for IP6 |
* System control for IP6 |
*/ |
*/ |
|
|
const u_char inet6ctlerrmap[PRC_NCMDS] = { |
u_char inet6ctlerrmap[PRC_NCMDS] = { |
0, 0, 0, 0, |
0, 0, 0, 0, |
0, EMSGSIZE, EHOSTDOWN, EHOSTUNREACH, |
0, EMSGSIZE, EHOSTDOWN, EHOSTUNREACH, |
EHOSTUNREACH, EHOSTUNREACH, ECONNREFUSED, ECONNREFUSED, |
EHOSTUNREACH, EHOSTUNREACH, ECONNREFUSED, ECONNREFUSED, |
Line 1663 const u_char inet6ctlerrmap[PRC_NCMDS] = |
|
Line 1650 const u_char inet6ctlerrmap[PRC_NCMDS] = |
|
static int |
static int |
sysctl_net_inet6_ip6_stats(SYSCTLFN_ARGS) |
sysctl_net_inet6_ip6_stats(SYSCTLFN_ARGS) |
{ |
{ |
|
netstat_sysctl_context ctx; |
|
uint64_t ip6s[IP6_NSTATS]; |
|
|
return (NETSTAT_SYSCTL(ip6stat_percpu, IP6_NSTATS)); |
ctx.ctx_stat = ip6stat_percpu; |
|
ctx.ctx_counters = ip6s; |
|
ctx.ctx_ncounters = IP6_NSTATS; |
|
return (NETSTAT_SYSCTL(&ctx)); |
} |
} |
|
|
SYSCTL_SETUP(sysctl_net_inet6_ip6_setup, "sysctl net.inet6.ip6 subtree setup") |
SYSCTL_SETUP(sysctl_net_inet6_ip6_setup, "sysctl net.inet6.ip6 subtree setup") |