Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/ip_input.c
Show First 20 Lines • Show All 554 Lines • ▼ Show 20 Lines | if (m->m_len == m->m_pkthdr.len) { | ||||
m->m_len = ip_len; | m->m_len = ip_len; | ||||
m->m_pkthdr.len = ip_len; | m->m_pkthdr.len = ip_len; | ||||
} else | } else | ||||
m_adj(m, ip_len - m->m_pkthdr.len); | m_adj(m, ip_len - m->m_pkthdr.len); | ||||
} | } | ||||
/* | /* | ||||
* Try to forward the packet, but if we fail continue. | * Try to forward the packet, but if we fail continue. | ||||
* ip_tryforward() does not generate redirects, so fall | * ip_tryforward() may generate redirects these days. | ||||
* through to normal processing if redirects are required. | * XXX the logic below falling through to normal processing | ||||
* if redirects are required should be revisited as well. | |||||
* ip_tryforward() does inbound and outbound packet firewall | * ip_tryforward() does inbound and outbound packet firewall | ||||
* processing. If firewall has decided that destination becomes | * processing. If firewall has decided that destination becomes | ||||
* our local address, it sets M_FASTFWD_OURS flag. In this | * our local address, it sets M_FASTFWD_OURS flag. In this | ||||
* case skip another inbound firewall processing and update | * case skip another inbound firewall processing and update | ||||
* ip pointer. | * ip pointer. | ||||
*/ | */ | ||||
if (V_ipforwarding != 0 | if (V_ipforwarding != 0 | ||||
#if defined(IPSEC) || defined(IPSEC_SUPPORT) | #if defined(IPSEC) || defined(IPSEC_SUPPORT) | ||||
&& (!IPSEC_ENABLED(ipv4) || | && (!IPSEC_ENABLED(ipv4) || | ||||
IPSEC_CAPS(ipv4, m, IPSEC_CAP_OPERABLE) == 0) | IPSEC_CAPS(ipv4, m, IPSEC_CAP_OPERABLE) == 0) | ||||
#endif | #endif | ||||
) { | ) { | ||||
/* | |||||
* ip_dooptions() was run so we can ignore the source route (or | |||||
* any IP options case) case for redirects in ip_tryforward(). | |||||
*/ | |||||
if ((m = ip_tryforward(m)) == NULL) | if ((m = ip_tryforward(m)) == NULL) | ||||
return; | return; | ||||
if (m->m_flags & M_FASTFWD_OURS) { | if (m->m_flags & M_FASTFWD_OURS) { | ||||
m->m_flags &= ~M_FASTFWD_OURS; | m->m_flags &= ~M_FASTFWD_OURS; | ||||
ip = mtod(m, struct ip *); | ip = mtod(m, struct ip *); | ||||
goto ours; | goto ours; | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 851 Lines • Show Last 20 Lines |