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
F102978604: D40598.diff
Tue, Nov 19, 10:25 AM
Unknown Object (File)
Sep 27 2024, 1:05 PM
Unknown Object (File)
Sep 27 2024, 12:52 PM
Unknown Object (File)
Sep 27 2024, 12:52 PM
Unknown Object (File)
Sep 27 2024, 7:15 AM
Unknown Object (File)
Sep 24 2024, 12:36 AM
Unknown Object (File)
Sep 23 2024, 11:21 PM
Unknown Object (File)
Sep 23 2024, 10:28 PM

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