git: 9front

Download patch

ref: 7a73a8f0179396a7d182e0615e72d4e26bc8abc3
parent: 51a2ff98fa806e6cb99d270a631ebb8e98e7420e
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Fri Jul 14 20:48:52 EDT 2023

etherimx: ignore trailing 4 byte garbage in ethernet receive packet

There are 4 trailing bytes (fcs?) in the received packet,
which is a problem for devbridge when forwarding
the frame to another interface as it makes it oversized.

--- a/sys/src/9/imx8/etherimx.c
+++ b/sys/src/9/imx8/etherimx.c
@@ -435,7 +435,7 @@
 		}
 		if(((s^RD_L) & (RD_L|RD_ERR)) == 0){
 			b = ctlr->rx->b[i];
-			b->wp = b->rp + (s & RD_LEN);
+			b->wp = b->rp + (s & RD_LEN) - 4;
 			dmaflush(0, b->rp, BLEN(b));
 			etheriq(edev, b);
 
--