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.
This commit is contained in:
Mike Karels 2022-10-25 14:23:18 -05:00
parent 6b69465efb
commit 234c1463a7

View File

@ -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