summaryrefslogtreecommitdiff
path: root/sys/net/if_ethersubr.c
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2021-02-06 13:15:38 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2021-02-06 13:15:38 +0000
commit18832472191f327dbb28e24e61d7f2f27882de25 (patch)
treec503a3c926b80ebe23f2903e652cca6fcd1670c9 /sys/net/if_ethersubr.c
parent820a444e54da8488f0f2129a2d7f347d63967218 (diff)
Simplex interface sends packet back without hardware checksum
offloading. The checksum must be calculated in software. Use the same condition in ether_resolve() to send the broadcast packet back to the stack and in in_ifcap_cksum() to force software checksumming. This fixes regress/sys/kern/sosplice/loop. OK procter@
Diffstat (limited to 'sys/net/if_ethersubr.c')
-rw-r--r--sys/net/if_ethersubr.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index 6a8c678c6bf..47d74957fdf 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ethersubr.c,v 1.269 2021/02/05 16:47:48 bluhm Exp $ */
+/* $OpenBSD: if_ethersubr.c,v 1.270 2021/02/06 13:15:37 bluhm Exp $ */
/* $NetBSD: if_ethersubr.c,v 1.19 1996/05/07 02:40:30 thorpej Exp $ */
/*
@@ -227,7 +227,11 @@ ether_resolve(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
return (error);
eh->ether_type = htons(ETHERTYPE_IP);
- /* If broadcasting on a simplex interface, loopback a copy */
+ /*
+ * If broadcasting on a simplex interface, loopback a copy.
+ * The checksum must be calculated in software. Keep the
+ * condition in sync with in_ifcap_cksum().
+ */
if (ISSET(m->m_flags, M_BCAST) &&
ISSET(ifp->if_flags, IFF_SIMPLEX) &&
!m->m_pkthdr.pf.routed) {