diff options
author | 2021-02-06 13:15:37 +0000 | |
---|---|---|
committer | 2021-02-06 13:15:37 +0000 | |
commit | 300935e6f8e60f9033e769636612c03ac1878c1d (patch) | |
tree | edca019c23af4b61ee8ff517b1a09bc8343bbdd4 /sys/net | |
parent | In the end UTF-8 did not become a terminal feature, should not be listed (diff) | |
download | wireguard-openbsd-300935e6f8e60f9033e769636612c03ac1878c1d.tar.xz wireguard-openbsd-300935e6f8e60f9033e769636612c03ac1878c1d.zip |
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')
-rw-r--r-- | sys/net/if_ethersubr.c | 8 |
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) { |