Page MenuHomeFreeBSD

netinet6: Implement in6_cksum_partial() using m_apply()
ClosedPublic

Authored by markj on Jun 18 2023, 2:22 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 26, 12:52 AM
Unknown Object (File)
Mar 16 2024, 9:46 PM
Unknown Object (File)
Mar 14 2024, 7:24 AM
Unknown Object (File)
Mar 14 2024, 7:24 AM
Unknown Object (File)
Mar 14 2024, 6:08 AM
Unknown Object (File)
Jan 28 2024, 2:21 AM
Unknown Object (File)
Dec 27 2023, 1:17 AM
Unknown Object (File)
Dec 25 2023, 5:41 AM

Details

Summary

This ensures that in6_cksum_partial() can be applied to unmapped mbufs,
which can happen at least when icmp6_reflect() quotes a packet.

The basic idea is to restructure in6_cksum_partial() to operate on one
mbuf at a time. If the buffer length is odd or unaligned, an extra
residual byte may be returned, to be incorporated into the checksum when
processing the next buffer.

PR: 268400

Test Plan

I ported both versions to run in userspace, then wrote a little harness
to generate a sequence of random packets and compute checksums
generated by the two implementations. They all matched on 100000
iterations of the test.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable