sctp: Remove now-unneeded mb_unmapped_to_ext() calls

sctp_delayed_checksum() now handles unmapped mbufs, thanks to m_apply().

No functional change intended.

Reviewed by:	tuexen
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32942
This commit is contained in:
Mark Johnston 2021-11-16 13:38:09 -05:00
parent b4d758a0cc
commit 756bb50b6a
4 changed files with 0 additions and 33 deletions

View File

@ -220,9 +220,6 @@ divert_packet(struct mbuf *m, bool incoming)
}
#if defined(SCTP) || defined(SCTP_SUPPORT)
if (m->m_pkthdr.csum_flags & CSUM_SCTP) {
m = mb_unmapped_to_ext(m);
if (m == NULL)
return;
sctp_delayed_cksum(m, (uint32_t)(ip->ip_hl << 2));
m->m_pkthdr.csum_flags &= ~CSUM_SCTP;
}
@ -238,9 +235,6 @@ divert_packet(struct mbuf *m, bool incoming)
}
#if defined(SCTP) || defined(SCTP_SUPPORT)
if (m->m_pkthdr.csum_flags & CSUM_SCTP_IPV6) {
m = mb_unmapped_to_ext(m);
if (m == NULL)
return;
sctp_delayed_cksum(m, sizeof(struct ip6_hdr));
m->m_pkthdr.csum_flags &= ~CSUM_SCTP_IPV6;
}

View File

@ -753,12 +753,6 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct route *ro, int flags,
}
#if defined(SCTP) || defined(SCTP_SUPPORT)
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));
m->m_pkthdr.csum_flags &= ~CSUM_SCTP;
}
@ -911,12 +905,6 @@ ip_fragment(struct ip *ip, struct mbuf **m_frag, int mtu,
}
#if defined(SCTP) || defined(SCTP_SUPPORT)
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);
m0->m_pkthdr.csum_flags &= ~CSUM_SCTP;
}

View File

@ -411,12 +411,6 @@ ipsec4_common_output(struct mbuf *m, struct inpcb *inp, int forwarding)
if (m->m_pkthdr.csum_flags & CSUM_SCTP) {
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 *);
sctp_delayed_cksum(m, (uint32_t)(ip->ip_hl << 2));
m->m_pkthdr.csum_flags &= ~CSUM_SCTP;
@ -791,12 +785,6 @@ ipsec6_common_output(struct mbuf *m, struct inpcb *inp, int forwarding)
}
#if defined(SCTP) || defined(SCTP_SUPPORT)
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));
m->m_pkthdr.csum_flags &= ~CSUM_SCTP_IPV6;
}

View File

@ -6000,9 +6000,6 @@ pf_route(struct mbuf **m, struct pf_krule *r, int dir, struct ifnet *oifp,
}
#if defined(SCTP) || defined(SCTP_SUPPORT)
if (m0->m_pkthdr.csum_flags & CSUM_SCTP & ~ifp->if_hwassist) {
m0 = mb_unmapped_to_ext(m0);
if (m0 == NULL)
goto done;
sctp_delayed_cksum(m0, (uint32_t)(ip->ip_hl << 2));
m0->m_pkthdr.csum_flags &= ~CSUM_SCTP;
}