On Sun, Aug 07, 2022 at 12:41:29AM +0200, Alexander Bluhm wrote:
> Hi,
> 
> If interface drivers have enabled transmit offloading for the payload
> checksum , IPv6 fragments contain invalid checksum.  For fragments
> the protocol checksum has to be calculated before fragmentation.
> Hardware cannot do this as it is too late.  Do it earlier in software.
> 
> ip_fragement() has such code, but in IPv6 it is missing.  Note that
> in6_proto_cksum_out() has to be called before the next protocol is
> set to IPPROTO_FRAGMENT.
> 
> ok?
> 
> bluhm
> 
> Index: netinet6/ip6_output.c
> ===================================================================
> RCS file: /data/mirror/openbsd/cvs/src/sys/netinet6/ip6_output.c,v
> retrieving revision 1.269
> diff -u -p -r1.269 ip6_output.c
> --- netinet6/ip6_output.c     29 Jun 2022 22:45:24 -0000      1.269
> +++ netinet6/ip6_output.c     6 Aug 2022 22:21:04 -0000
> @@ -729,6 +729,12 @@ reroute:
>               mtu = IPV6_MAXPACKET;
>  
>       /*
> +      * If we are doing fragmentation, we can't defer TCP/UDP
> +      * checksumming; compute the checksum and clear the flag.
> +      */
> +        in6_proto_cksum_out(m, NULL);
> +
> +     /*
>        * Change the next header field of the last header in the
>        * unfragmentable part.
>        */
> 

tested this using udp on em (with and without my offloading diff),
igc, and ix openbsd-linux and linux-openbsd-linux-forwarding.
ok mbuhl

Reply via email to