diff options
| author | Mike Karels <karels@FreeBSD.org> | 2022-05-09 12:19:52 +0000 |
|---|---|---|
| committer | Mike Karels <karels@FreeBSD.org> | 2022-05-23 11:53:01 +0000 |
| commit | 7e6e22aab6b993e42328bafe0f64ee14a2b7c43c (patch) | |
| tree | 7bef793cc48e3690b42ee909dbd91da99cb906bc | |
| parent | fb231965f9b7b3930b19f95e454eb86b348e0640 (diff) | |
| download | src-7e6e22aab6b993e42328bafe0f64ee14a2b7c43c.tar.gz src-7e6e22aab6b993e42328bafe0f64ee14a2b7c43c.zip | |
genet: fix output packet corruption in uncommon case
The code for the "shift" block in the COPY macro set the pointer for
the next copy block to the wrong value. In this case, the link-layer
header would be overwritten by the network-layer header. This case is
difficult or impossible to exercise in the current driver without
changing the value of the hw.genet.tx_hdr_min sysctl. Correct the
pointer. While here, remove a line in the macro that was marked
"unneeded", which was actually wrong.
PR: 263824
Submitted by: jiahali@blackberry.com
(cherry picked from commit 1de9aa4d4f7938f36e6485dad817908a6e45bb32)
| -rw-r--r-- | sys/arm64/broadcom/genet/if_genet.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/arm64/broadcom/genet/if_genet.c b/sys/arm64/broadcom/genet/if_genet.c index 4532c8d32f90..2437e9ae206c 100644 --- a/sys/arm64/broadcom/genet/if_genet.c +++ b/sys/arm64/broadcom/genet/if_genet.c @@ -1254,11 +1254,10 @@ gen_parse_tx(struct mbuf *m, int csum_flags) m0->m_data = m0->m_pktdat; \ bcopy(p0, mtodo(m0, sizeof(struct statusblock)),\ m0->m_len - sizeof(struct statusblock)); \ - copy_p = mtodo(m0, sizeof(struct statusblock)); \ + copy_p = mtodo(m0, m0->m_len); \ } \ bcopy(p, copy_p, hsize); \ m0->m_len += hsize; \ - m0->m_pkthdr.len += hsize; /* unneeded */ \ m->m_len -= hsize; \ m->m_data += hsize; \ } \ |
