]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
sctp: Use m_apply() to calcuate a checksum for an mbuf chain
authorMark Johnston <markj@FreeBSD.org>
Tue, 16 Nov 2021 18:36:30 +0000 (13:36 -0500)
committerMark Johnston <markj@FreeBSD.org>
Tue, 30 Nov 2021 01:35:08 +0000 (20:35 -0500)
commit422456ae27f5f79dee3969de9190fbe9b9301c3c
treed3730ed6bfc7f3eb702c8ffcc9d0c18436364cff
parent02e3eb8d482d513f1870b36c523a8f39a1c67b94
sctp: Use m_apply() to calcuate a checksum for an mbuf chain

m_apply() works on unmapped mbufs, so this will let us elide
mb_unmapped_to_ext() calls preceding sctp_calculate_cksum() calls in
the network stack.

Modify sctp_calculate_cksum() to assume it's passed an mbuf header.
This assumption appears to be true in practice, and we need to know the
full length of the chain.

No functional change intended.

Reviewed by: tuexen, jhb
Sponsored by: The FreeBSD Foundation

(cherry picked from commit b4d758a0cc54d991d2bdf7f697ec0b6b3fd6230d)
sys/netinet/sctp_crc32.c