From: bluhm Date: Mon, 8 Aug 2022 23:00:51 +0000 (+0000) Subject: If interface drivers had enabled transmit offloading of the payload X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=ce9d227ca689b46a6aa4422dff4111342cf0c0e5;p=openbsd If interface drivers had enabled transmit offloading of the payload checksum, IPv6 fragments contained 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. tested and OK mbuhl@ --- diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index 8fbac583874..355aa3edc4a 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_output.c,v 1.269 2022/06/29 22:45:24 bluhm Exp $ */ +/* $OpenBSD: ip6_output.c,v 1.270 2022/08/08 23:00:51 bluhm Exp $ */ /* $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $ */ /* @@ -728,6 +728,12 @@ reroute: if (mtu > IPV6_MAXPACKET) 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.