HomeFreeBSD

MFC r358297: Fix IPv6 checksums when exthdrs are present.

Description

MFC r358297: Fix IPv6 checksums when exthdrs are present.

In two places in ip6_output we are doing (delayed) checksum calculations.
The initial logic came from SCTP in r205075,205104 and later I copied
and adjusted it for the TCP|UDP case in r235958.
The problem was that the original SCTP offsets were already wrong for any
case with extension headers present given IPv6 extension headers are not
part of the pseudo checksum calculations.
The later changes do not help in case there is checksum offloading as for
extension headers (incl. fragments) we do currrently never offload as we
have no infrastructure to know whether the NIC can handle these cases.

Correct the offsets for delayed checksum calculations and properly handle
mbuf flags.  In addition harmonize the almost identical duplicate code.

While here eliminate the now unneeded variable hlen and add an always
missing mtod() call in the 1-b and 3 cases after the introduction of
the mb_unmapped_to_ext() calls. [Keep code in sync with head]

Reported by: Francis Dupont (fdupont isc.org)
PR: 243675

Details

Provenance
bzAuthored on
Parents
rS358556: Add support for the TFTP windowsize option described in RFC 7440.
Branches
Unknown
Tags
Unknown