Changeset View
Changeset View
Standalone View
Standalone View
sys/netpfil/pf/pf.c
Show First 20 Lines • Show All 5,986 Lines • ▼ Show 20 Lines | if (ifp->if_flags & IFF_LOOPBACK) | ||||
m0->m_flags |= M_SKIP_FIREWALL; | m0->m_flags |= M_SKIP_FIREWALL; | ||||
ip_len = ntohs(ip->ip_len); | ip_len = ntohs(ip->ip_len); | ||||
ip_off = ntohs(ip->ip_off); | ip_off = ntohs(ip->ip_off); | ||||
/* Copied from FreeBSD 10.0-CURRENT ip_output. */ | /* Copied from FreeBSD 10.0-CURRENT ip_output. */ | ||||
m0->m_pkthdr.csum_flags |= CSUM_IP; | m0->m_pkthdr.csum_flags |= CSUM_IP; | ||||
if (m0->m_pkthdr.csum_flags & CSUM_DELAY_DATA & ~ifp->if_hwassist) { | if (m0->m_pkthdr.csum_flags & CSUM_DELAY_DATA & ~ifp->if_hwassist) { | ||||
m0 = mb_unmapped_to_ext(m0); | |||||
if (m0 == NULL) | |||||
goto done; | |||||
in_delayed_cksum(m0); | in_delayed_cksum(m0); | ||||
m0->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; | m0->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; | ||||
} | } | ||||
#if defined(SCTP) || defined(SCTP_SUPPORT) | #if defined(SCTP) || defined(SCTP_SUPPORT) | ||||
if (m0->m_pkthdr.csum_flags & CSUM_SCTP & ~ifp->if_hwassist) { | if (m0->m_pkthdr.csum_flags & CSUM_SCTP & ~ifp->if_hwassist) { | ||||
sctp_delayed_cksum(m0, (uint32_t)(ip->ip_hl << 2)); | sctp_delayed_cksum(m0, (uint32_t)(ip->ip_hl << 2)); | ||||
m0->m_pkthdr.csum_flags &= ~CSUM_SCTP; | m0->m_pkthdr.csum_flags &= ~CSUM_SCTP; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 170 Lines • ▼ Show 20 Lines | pf_route6(struct mbuf **m, struct pf_krule *r, int dir, struct ifnet *oifp, | ||||
} | } | ||||
if (ifp->if_flags & IFF_LOOPBACK) | if (ifp->if_flags & IFF_LOOPBACK) | ||||
m0->m_flags |= M_SKIP_FIREWALL; | m0->m_flags |= M_SKIP_FIREWALL; | ||||
if (m0->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6 & | if (m0->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6 & | ||||
~ifp->if_hwassist) { | ~ifp->if_hwassist) { | ||||
uint32_t plen = m0->m_pkthdr.len - sizeof(*ip6); | uint32_t plen = m0->m_pkthdr.len - sizeof(*ip6); | ||||
m0 = mb_unmapped_to_ext(m0); | |||||
if (m0 == NULL) | |||||
goto done; | |||||
in6_delayed_cksum(m0, plen, sizeof(struct ip6_hdr)); | in6_delayed_cksum(m0, plen, sizeof(struct ip6_hdr)); | ||||
m0->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6; | m0->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6; | ||||
} | } | ||||
/* | /* | ||||
* If the packet is too large for the outgoing interface, | * If the packet is too large for the outgoing interface, | ||||
* send back an icmp6 error. | * send back an icmp6 error. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 1,175 Lines • Show Last 20 Lines |