summaryrefslogtreecommitdiff
path: root/sys/netinet6
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2022-08-08 23:00:52 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2022-08-08 23:00:52 +0000
commitfb3a2e00e6da58900fad175baf449ca5e64c71d8 (patch)
tree660fec94bd755c7e1fafab224eab1172ff164926 /sys/netinet6
parent63bc1c4f5ffaa7662f32b72351a683768251e2b6 (diff)
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@
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/ip6_output.c8
1 files changed, 7 insertions, 1 deletions
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 $ */
/*
@@ -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.
*/