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)
Sat, Jan 31, 12:08 PM
Unknown Object (File)
Sat, Jan 31, 4:48 AM
Unknown Object (File)
Dec 24 2025, 11:36 PM
Unknown Object (File)
Dec 20 2025, 9:45 PM
Unknown Object (File)
Nov 29 2025, 1:11 AM
Unknown Object (File)
Nov 26 2025, 8:56 AM
Unknown Object (File)
Nov 22 2025, 4:58 AM
Unknown Object (File)
Nov 20 2025, 8:16 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