Changeset View
Changeset View
Standalone View
Standalone View
sys/netipsec/ipsec_output.c
Show First 20 Lines • Show All 392 Lines • ▼ Show 20 Lines | ipsec4_common_output(struct mbuf *m, struct inpcb *inp, int forwarding) | ||||
* return back to us. | * return back to us. | ||||
*/ | */ | ||||
if (!forwarding) { | if (!forwarding) { | ||||
/* | /* | ||||
* Do delayed checksums now because we send before | * Do delayed checksums now because we send before | ||||
* this is done in the normal processing path. | * this is done in the normal processing path. | ||||
*/ | */ | ||||
if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { | if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { | ||||
m = mb_unmapped_to_ext(m); | |||||
if (m == NULL) { | |||||
IPSECSTAT_INC(ips_out_nomem); | |||||
key_freesp(&sp); | |||||
return (ENOBUFS); | |||||
} | |||||
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; | ||||
ip = mtod(m, struct ip *); | ip = mtod(m, struct ip *); | ||||
▲ Show 20 Lines • Show All 353 Lines • ▼ Show 20 Lines | ipsec6_common_output(struct mbuf *m, struct inpcb *inp, int forwarding) | ||||
} | } | ||||
if (!forwarding) { | if (!forwarding) { | ||||
/* | /* | ||||
* Do delayed checksums now because we send before | * Do delayed checksums now because we send before | ||||
* this is done in the normal processing path. | * this is done in the normal processing path. | ||||
*/ | */ | ||||
if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6) { | if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6) { | ||||
m = mb_unmapped_to_ext(m); | |||||
if (m == NULL) { | |||||
IPSEC6STAT_INC(ips_out_nomem); | |||||
key_freesp(&sp); | |||||
return (ENOBUFS); | |||||
} | |||||
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) { | ||||
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; | ||||
▲ Show 20 Lines • Show All 402 Lines • Show Last 20 Lines |