Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet6/ip6_forward.c
Show First 20 Lines • Show All 109 Lines • ▼ Show 20 Lines | ip6_forward(struct mbuf *m, int srcrt) | ||||
*/ | */ | ||||
if ((m->m_flags & (M_BCAST|M_MCAST)) != 0 || | if ((m->m_flags & (M_BCAST|M_MCAST)) != 0 || | ||||
IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst) || | IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst) || | ||||
IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_src)) { | IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_src)) { | ||||
IP6STAT_INC(ip6s_cantforward); | IP6STAT_INC(ip6s_cantforward); | ||||
/* XXX in6_ifstat_inc(rt->rt_ifp, ifs6_in_discard) */ | /* XXX in6_ifstat_inc(rt->rt_ifp, ifs6_in_discard) */ | ||||
if (V_ip6_log_time + V_ip6_log_interval < time_uptime) { | if (V_ip6_log_time + V_ip6_log_interval < time_uptime) { | ||||
V_ip6_log_time = time_uptime; | V_ip6_log_time = time_uptime; | ||||
log(LOG_DEBUG, | nd6log((LOG_DEBUG, | ||||
"cannot forward " | "cannot forward " | ||||
"from %s to %s nxt %d received on %s\n", | "from %s to %s nxt %d received on %s\n", | ||||
ip6_sprintf(ip6bufs, &ip6->ip6_src), | ip6_sprintf(ip6bufs, &ip6->ip6_src), | ||||
ip6_sprintf(ip6bufd, &ip6->ip6_dst), | ip6_sprintf(ip6bufd, &ip6->ip6_dst), | ||||
ip6->ip6_nxt, | ip6->ip6_nxt, | ||||
if_name(m->m_pkthdr.rcvif)); | if_name(m->m_pkthdr.rcvif))); | ||||
} | } | ||||
m_freem(m); | m_freem(m); | ||||
return; | return; | ||||
} | } | ||||
if ( | if ( | ||||
#ifdef IPSTEALTH | #ifdef IPSTEALTH | ||||
V_ip6stealth == 0 && | V_ip6stealth == 0 && | ||||
▲ Show 20 Lines • Show All 75 Lines • ▼ Show 20 Lines | again: | ||||
inzone = in6_get_unicast_scopeid(&ip6->ip6_src, m->m_pkthdr.rcvif); | inzone = in6_get_unicast_scopeid(&ip6->ip6_src, m->m_pkthdr.rcvif); | ||||
if (inzone != outzone) { | if (inzone != outzone) { | ||||
IP6STAT_INC(ip6s_cantforward); | IP6STAT_INC(ip6s_cantforward); | ||||
IP6STAT_INC(ip6s_badscope); | IP6STAT_INC(ip6s_badscope); | ||||
in6_ifstat_inc(nh->nh_ifp, ifs6_in_discard); | in6_ifstat_inc(nh->nh_ifp, ifs6_in_discard); | ||||
if (V_ip6_log_time + V_ip6_log_interval < time_uptime) { | if (V_ip6_log_time + V_ip6_log_interval < time_uptime) { | ||||
V_ip6_log_time = time_uptime; | V_ip6_log_time = time_uptime; | ||||
log(LOG_DEBUG, | nd6log((LOG_DEBUG, | ||||
"cannot forward " | "cannot forward " | ||||
"src %s, dst %s, nxt %d, rcvif %s, outif %s\n", | "src %s, dst %s, nxt %d, rcvif %s, outif %s\n", | ||||
ip6_sprintf(ip6bufs, &ip6->ip6_src), | ip6_sprintf(ip6bufs, &ip6->ip6_src), | ||||
ip6_sprintf(ip6bufd, &ip6->ip6_dst), | ip6_sprintf(ip6bufd, &ip6->ip6_dst), | ||||
ip6->ip6_nxt, | ip6->ip6_nxt, | ||||
if_name(m->m_pkthdr.rcvif), if_name(nh->nh_ifp)); | if_name(m->m_pkthdr.rcvif), if_name(nh->nh_ifp))); | ||||
} | } | ||||
if (mcopy) | if (mcopy) | ||||
icmp6_error(mcopy, ICMP6_DST_UNREACH, | icmp6_error(mcopy, ICMP6_DST_UNREACH, | ||||
ICMP6_DST_UNREACH_BEYONDSCOPE, 0); | ICMP6_DST_UNREACH_BEYONDSCOPE, 0); | ||||
goto bad; | goto bad; | ||||
} | } | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 226 Lines • Show Last 20 Lines |