Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/ip_output.c
Show First 20 Lines • Show All 742 Lines • ▼ Show 20 Lines | if ((ifp->if_capenable & IFCAP_MEXTPG) == 0) { | ||||
if (m == NULL) { | if (m == NULL) { | ||||
IPSTAT_INC(ips_odropped); | IPSTAT_INC(ips_odropped); | ||||
error = ENOBUFS; | error = ENOBUFS; | ||||
goto bad; | goto bad; | ||||
} | } | ||||
} | } | ||||
#if defined(SCTP) || defined(SCTP_SUPPORT) | #if defined(SCTP) || defined(SCTP_SUPPORT) | ||||
if (m->m_pkthdr.csum_flags & CSUM_SCTP & ~ifp->if_hwassist) { | if (m->m_pkthdr.csum_flags & CSUM_SCTP & ~ifp->if_hwassist) { | ||||
m = mb_unmapped_to_ext(m); | |||||
if (m == NULL) { | |||||
IPSTAT_INC(ips_odropped); | |||||
error = ENOBUFS; | |||||
goto bad; | |||||
} | |||||
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 | ||||
/* | /* | ||||
* If small enough for interface, or the interface will take | * If small enough for interface, or the interface will take | ||||
* care of the fragmentation for us, we can just send directly. | * care of the fragmentation for us, we can just send directly. | ||||
▲ Show 20 Lines • Show All 130 Lines • ▼ Show 20 Lines | ip_fragment(struct ip *ip, struct mbuf **m_frag, int mtu, | ||||
* fragmented packets, then do it here. | * fragmented packets, then do it here. | ||||
*/ | */ | ||||
if (m0->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { | if (m0->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { | ||||
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) { | if (m0->m_pkthdr.csum_flags & CSUM_SCTP) { | ||||
m0 = mb_unmapped_to_ext(m0); | |||||
if (m0 == NULL) { | |||||
error = ENOBUFS; | |||||
IPSTAT_INC(ips_odropped); | |||||
goto done; | |||||
} | |||||
sctp_delayed_cksum(m0, hlen); | sctp_delayed_cksum(m0, hlen); | ||||
m0->m_pkthdr.csum_flags &= ~CSUM_SCTP; | m0->m_pkthdr.csum_flags &= ~CSUM_SCTP; | ||||
} | } | ||||
#endif | #endif | ||||
if (len > PAGE_SIZE) { | if (len > PAGE_SIZE) { | ||||
/* | /* | ||||
* Fragment large datagrams such that each segment | * Fragment large datagrams such that each segment | ||||
* contains a multiple of PAGE_SIZE amount of data, | * contains a multiple of PAGE_SIZE amount of data, | ||||
▲ Show 20 Lines • Show All 701 Lines • Show Last 20 Lines |