HomeFreeBSD

tcp: fix checksum calculation bug

Description

tcp: fix checksum calculation bug

The new function in_delayed_cksum_o() was introduced to compute
the checksum in the case the mbuf chain does not start with the
IP header. The offset of the IP header is specified by the
parameter iph_offset.
If iph_offset was positive, the function computed an incorrect
checksum.

Reviewed by: sobomax, tuexen
Fixes: 5feb38e37847 ("netinet: provide "at offset" variant of the in_delayed_cksum() API")
Differential Revision: https://reviews.freebsd.org/D54269

(cherry picked from commit c8b3b605ae854ead6c8804e0400d80cb8fa73fdf)

Details

Provenance
timo.voelker_fh-muenster.deAuthored on Dec 19 2025, 4:50 PM
tuexenCommitted on Jan 21 2026, 12:46 PM
Reviewer
rG5feb38e37847: netinet: provide "at offset" variant of the in_delayed_cksum() API
Differential Revision
D54269: netinet: fix checksum calculation bug
Parents
rGc1b29bcd789e: vtnet: improve consistency
Branches
Unknown
Tags
Unknown