Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet6/ip6_input.c
Show First 20 Lines • Show All 171 Lines • ▼ Show 20 Lines | SYSCTL_PROC(_net_inet6_ip6, IPV6CTL_INTRQMAXLEN, intr_queue_maxlen, | ||||
"Maximum size of the IPv6 input queue"); | "Maximum size of the IPv6 input queue"); | ||||
VNET_DEFINE_STATIC(bool, ip6_sav) = true; | VNET_DEFINE_STATIC(bool, ip6_sav) = true; | ||||
#define V_ip6_sav VNET(ip6_sav) | #define V_ip6_sav VNET(ip6_sav) | ||||
SYSCTL_BOOL(_net_inet6_ip6, OID_AUTO, source_address_validation, | SYSCTL_BOOL(_net_inet6_ip6, OID_AUTO, source_address_validation, | ||||
CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_sav), true, | CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_sav), true, | ||||
"Drop incoming packets with source address that is a local address"); | "Drop incoming packets with source address that is a local address"); | ||||
VNET_DEFINE_STATIC(bool, ip6_filter_local_output) = false; | |||||
#define V_ip6_filter_local_output VNET(ip6_filter_local_output) | |||||
SYSCTL_BOOL(_net_inet6_ip6, OID_AUTO, filter_local_output, | |||||
CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_filter_local_output), false, | |||||
"Generate filter output events for packets delivered for local processing"); | |||||
#ifdef RSS | #ifdef RSS | ||||
static struct netisr_handler ip6_direct_nh = { | static struct netisr_handler ip6_direct_nh = { | ||||
.nh_name = "ip6_direct", | .nh_name = "ip6_direct", | ||||
.nh_handler = ip6_direct_input, | .nh_handler = ip6_direct_input, | ||||
.nh_proto = NETISR_IPV6_DIRECT, | .nh_proto = NETISR_IPV6_DIRECT, | ||||
.nh_m2cpuid = rss_soft_m2cpuid_v6, | .nh_m2cpuid = rss_soft_m2cpuid_v6, | ||||
.nh_policy = NETISR_POLICY_CPU, | .nh_policy = NETISR_POLICY_CPU, | ||||
.nh_dispatch = NETISR_DISPATCH_HYBRID, | .nh_dispatch = NETISR_DISPATCH_HYBRID, | ||||
▲ Show 20 Lines • Show All 689 Lines • ▼ Show 20 Lines | if (V_ip6_mrouter && | ||||
*/ | */ | ||||
if (ip6_mforward && ip6_mforward(ip6, rcvif, m)) { | if (ip6_mforward && ip6_mforward(ip6, rcvif, m)) { | ||||
IP6STAT_INC(ip6s_cantforward); | IP6STAT_INC(ip6s_cantforward); | ||||
goto bad; | goto bad; | ||||
} | } | ||||
} else if (!ours) { | } else if (!ours) { | ||||
ip6_forward(m, srcrt); | ip6_forward(m, srcrt); | ||||
return; | return; | ||||
} | |||||
/* | |||||
* We are going to ship the packet to the local protocol stack. Call the | |||||
* filter again for this 'output' action, allowing redirect-like rules | |||||
* to adjust the source address. | |||||
*/ | |||||
if (PFIL_HOOKED_OUT(V_inet_pfil_head) && V_ip6_filter_local_output) { | |||||
if (pfil_mbuf_out(V_inet6_pfil_head, &m, V_loif, NULL) != | |||||
PFIL_PASS) | |||||
return; | |||||
if (m == NULL) /* consumed by filter */ | |||||
return; | |||||
ip6 = mtod(m, struct ip6_hdr *); | |||||
} | } | ||||
/* | /* | ||||
* Tell launch routine the next header | * Tell launch routine the next header | ||||
*/ | */ | ||||
IP6STAT_INC(ip6s_delivered); | IP6STAT_INC(ip6s_delivered); | ||||
in6_ifstat_inc(rcvif, ifs6_in_deliver); | in6_ifstat_inc(rcvif, ifs6_in_deliver); | ||||
nest = 0; | nest = 0; | ||||
▲ Show 20 Lines • Show All 818 Lines • Show Last 20 Lines |