Changeset View
Changeset View
Standalone View
Standalone View
sys/netipsec/ipsec_output.c
Show First 20 Lines • Show All 399 Lines • ▼ Show 20 Lines | if (!forwarding) { | ||||
if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { | if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { | ||||
in_delayed_cksum(m); | in_delayed_cksum(m); | ||||
m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; | m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; | ||||
} | } | ||||
#if defined(SCTP) || defined(SCTP_SUPPORT) | #if defined(SCTP) || defined(SCTP_SUPPORT) | ||||
if (m->m_pkthdr.csum_flags & CSUM_SCTP) { | if (m->m_pkthdr.csum_flags & CSUM_SCTP) { | ||||
struct ip *ip; | struct ip *ip; | ||||
m = mb_unmapped_to_ext(m); | |||||
if (m == NULL) { | |||||
IPSECSTAT_INC(ips_out_nomem); | |||||
key_freesp(&sp); | |||||
return (ENOBUFS); | |||||
} | |||||
ip = mtod(m, struct ip *); | ip = mtod(m, struct ip *); | ||||
sctp_delayed_cksum(m, (uint32_t)(ip->ip_hl << 2)); | sctp_delayed_cksum(m, (uint32_t)(ip->ip_hl << 2)); | ||||
m->m_pkthdr.csum_flags &= ~CSUM_SCTP; | m->m_pkthdr.csum_flags &= ~CSUM_SCTP; | ||||
} | } | ||||
#endif | #endif | ||||
} | } | ||||
/* NB: callee frees mbuf and releases reference to SP */ | /* NB: callee frees mbuf and releases reference to SP */ | ||||
error = ipsec4_check_pmtu(m, sp, forwarding); | error = ipsec4_check_pmtu(m, sp, forwarding); | ||||
▲ Show 20 Lines • Show All 352 Lines • ▼ Show 20 Lines | if (!forwarding) { | ||||
*/ | */ | ||||
if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6) { | if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6) { | ||||
in6_delayed_cksum(m, m->m_pkthdr.len - | in6_delayed_cksum(m, m->m_pkthdr.len - | ||||
sizeof(struct ip6_hdr), sizeof(struct ip6_hdr)); | sizeof(struct ip6_hdr), sizeof(struct ip6_hdr)); | ||||
m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6; | m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6; | ||||
} | } | ||||
#if defined(SCTP) || defined(SCTP_SUPPORT) | #if defined(SCTP) || defined(SCTP_SUPPORT) | ||||
if (m->m_pkthdr.csum_flags & CSUM_SCTP_IPV6) { | if (m->m_pkthdr.csum_flags & CSUM_SCTP_IPV6) { | ||||
m = mb_unmapped_to_ext(m); | |||||
if (m == NULL) { | |||||
IPSEC6STAT_INC(ips_out_nomem); | |||||
key_freesp(&sp); | |||||
return (ENOBUFS); | |||||
} | |||||
sctp_delayed_cksum(m, sizeof(struct ip6_hdr)); | sctp_delayed_cksum(m, sizeof(struct ip6_hdr)); | ||||
m->m_pkthdr.csum_flags &= ~CSUM_SCTP_IPV6; | m->m_pkthdr.csum_flags &= ~CSUM_SCTP_IPV6; | ||||
} | } | ||||
#endif | #endif | ||||
} | } | ||||
error = ipsec6_check_pmtu(m, sp, forwarding); | error = ipsec6_check_pmtu(m, sp, forwarding); | ||||
if (error != 0) { | if (error != 0) { | ||||
▲ Show 20 Lines • Show All 396 Lines • Show Last 20 Lines |