From nobody Tue Nov 16 18:52:45 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 0124E189DF7C; Tue, 16 Nov 2021 18:52:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HtwDG08kRz4ZPM; Tue, 16 Nov 2021 18:52:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C8C71295B; Tue, 16 Nov 2021 18:52:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AGIqjvD017941; Tue, 16 Nov 2021 18:52:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AGIqjV7017940; Tue, 16 Nov 2021 18:52:45 GMT (envelope-from git) Date: Tue, 16 Nov 2021 18:52:45 GMT Message-Id: <202111161852.1AGIqjV7017940@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 756bb50b6a86 - main - sctp: Remove now-unneeded mb_unmapped_to_ext() calls List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 756bb50b6a867f3309ce76d76f1842a667dd303a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=756bb50b6a867f3309ce76d76f1842a667dd303a commit 756bb50b6a867f3309ce76d76f1842a667dd303a Author: Mark Johnston AuthorDate: 2021-11-16 18:38:09 +0000 Commit: Mark Johnston CommitDate: 2021-11-16 18:38:09 +0000 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 --- sys/netinet/ip_divert.c | 6 ------ sys/netinet/ip_output.c | 12 ------------ sys/netipsec/ipsec_output.c | 12 ------------ sys/netpfil/pf/pf.c | 3 --- 4 files changed, 33 deletions(-) diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c index 3e1200b1ff1c..fb4eba220703 100644 --- a/sys/netinet/ip_divert.c +++ b/sys/netinet/ip_divert.c @@ -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; } diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index d850cf5b5167..cfa6b1919a06 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -753,12 +753,6 @@ sendit: } #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; } diff --git a/sys/netipsec/ipsec_output.c b/sys/netipsec/ipsec_output.c index 0a722140f93e..0b171e9c4970 100644 --- a/sys/netipsec/ipsec_output.c +++ b/sys/netipsec/ipsec_output.c @@ -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; } diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 9595650dbc36..8891ac75330a 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -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; }