[Midnightbsd-cvs] [MidnightBSD/src] cfad94: Fix IPv6 checksums when exthdrs are present.

Lucas Holt noreply at github.com
Sun Nov 15 02:02:14 EST 2020


  Branch: refs/heads/master
  Home:   https://github.com/MidnightBSD/src
  Commit: cfad94e67cdc8db0937dd0c40544d780146f6661
      https://github.com/MidnightBSD/src/commit/cfad94e67cdc8db0937dd0c40544d780146f6661
  Author: Lucas Holt <luke at foolishgames.com>
  Date:   2020-11-15 (Sun, 15 Nov 2020)

  Changed paths:
    M sys/netinet6/ip6_output.c

  Log Message:
  -----------
  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.

Obtained from: FreeBSD




More information about the Midnightbsd-cvs mailing list