Changeset View
Changeset View
Standalone View
Standalone View
sys/netipsec/ipsec_output.c
Show First 20 Lines • Show All 65 Lines • ▼ Show 20 Lines | |||||
#ifdef INET6 | #ifdef INET6 | ||||
#include <netinet6/ip6_var.h> | #include <netinet6/ip6_var.h> | ||||
#include <netinet6/scope6_var.h> | #include <netinet6/scope6_var.h> | ||||
#endif | #endif | ||||
#include <netinet/in_pcb.h> | #include <netinet/in_pcb.h> | ||||
#ifdef INET6 | #ifdef INET6 | ||||
#include <netinet/icmp6.h> | #include <netinet/icmp6.h> | ||||
#endif | #endif | ||||
#ifdef SCTP | #if defined(SCTP) || defined(SCTP_SUPPORT) | ||||
#include <netinet/sctp_crc32.h> | #include <netinet/sctp_crc32.h> | ||||
#endif | #endif | ||||
#include <netinet/udp.h> | #include <netinet/udp.h> | ||||
#include <netipsec/ah.h> | #include <netipsec/ah.h> | ||||
#include <netipsec/esp.h> | #include <netipsec/esp.h> | ||||
#include <netipsec/ipsec.h> | #include <netipsec/ipsec.h> | ||||
#ifdef INET6 | #ifdef INET6 | ||||
▲ Show 20 Lines • Show All 238 Lines • ▼ Show 20 Lines | 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) { | ||||
in_delayed_cksum(m); | in_delayed_cksum(m); | ||||
m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; | m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; | ||||
} | } | ||||
#ifdef SCTP | #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 = mtod(m, struct ip *); | 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 | ||||
} | } | ||||
▲ Show 20 Lines • Show All 278 Lines • ▼ Show 20 Lines | 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) { | ||||
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; | ||||
} | } | ||||
#ifdef SCTP | #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; | ||||
} | } | ||||
#endif | #endif | ||||
} | } | ||||
/* NB: callee frees mbuf and releases reference to SP */ | /* NB: callee frees mbuf and releases reference to SP */ | ||||
error = ipsec6_process_packet(m, sp, inp); | error = ipsec6_process_packet(m, sp, inp); | ||||
▲ Show 20 Lines • Show All 329 Lines • Show Last 20 Lines |