git: 234c1463a79a - main - genet: add another case where headers need pullup
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 29 Oct 2022 12:53:15 UTC
The branch main has been updated by karels:
URL: https://cgit.FreeBSD.org/src/commit/?id=234c1463a79a05e72b4167360c940b9bb2ca2f32
commit 234c1463a79a05e72b4167360c940b9bb2ca2f32
Author: Mike Karels <karels@FreeBSD.org>
AuthorDate: 2022-10-25 19:23:18 +0000
Commit: Mike Karels <karels@FreeBSD.org>
CommitDate: 2022-10-29 12:52:57 +0000
genet: add another case where headers need pullup
Wake On LAN packets sent by wake(8) via BPF are lost if txcsum is
enabled. These fall into the "other protocol" case where gen_parse_tx
did nothing. Add code to shift up to gen_tx_hdr_min bytes of the
packet along with the Ethernet header in this case.
---
sys/arm64/broadcom/genet/if_genet.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/sys/arm64/broadcom/genet/if_genet.c b/sys/arm64/broadcom/genet/if_genet.c
index 978106fdfad5..10ec4dde8955 100644
--- a/sys/arm64/broadcom/genet/if_genet.c
+++ b/sys/arm64/broadcom/genet/if_genet.c
@@ -1302,9 +1302,12 @@ gen_parse_tx(struct mbuf *m, int csum_flags)
offset += sizeof(struct ip6_hdr);
} else {
/*
- * Unknown whether other cases require moving a header;
- * ARP works without.
+ * Unknown whether most other cases require moving a header;
+ * ARP works without. However, Wake On LAN packets sent
+ * by wake(8) via BPF need something like this.
*/
+ COPY(MIN(gen_tx_hdr_min, m->m_len));
+ offset += MIN(gen_tx_hdr_min, m->m_len);
}
return (offset);
#undef COPY