-/* $OpenBSD: ip_output.c,v 1.387 2023/05/15 16:34:56 bluhm Exp $ */
+/* $OpenBSD: ip_output.c,v 1.388 2023/05/22 16:08:34 bluhm Exp $ */
/* $NetBSD: ip_output.c,v 1.28 1996/02/13 23:43:07 christos Exp $ */
/*
u_int16_t csum = 0, offset;
offset = ip->ip_hl << 2;
- if (ISSET(m->m_pkthdr.csum_flags, M_TCP_TSO)) {
+ if (ISSET(m->m_pkthdr.csum_flags, M_TCP_TSO) &&
+ in_ifcap_cksum(m, ifp, IFCAP_TSOv4)) {
csum = in_cksum_phdr(ip->ip_src.s_addr,
ip->ip_dst.s_addr, htonl(ip->ip_p));
} else if (ISSET(m->m_pkthdr.csum_flags,
-/* $OpenBSD: ip6_output.c,v 1.276 2023/05/15 16:34:57 bluhm Exp $ */
+/* $OpenBSD: ip6_output.c,v 1.277 2023/05/22 16:08:34 bluhm Exp $ */
/* $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $ */
/*
u_int16_t csum;
offset = ip6_lasthdr(m, 0, IPPROTO_IPV6, &nxt);
- if (ISSET(m->m_pkthdr.csum_flags, M_TCP_TSO)) {
+ if (ISSET(m->m_pkthdr.csum_flags, M_TCP_TSO) &&
+ in_ifcap_cksum(m, ifp, IFCAP_TSOv6)) {
csum = in6_cksum_phdr(&ip6->ip6_src, &ip6->ip6_dst,
htonl(0), htonl(nxt));
} else {