Skip to content

Commit 6d2bc4f

Browse files
Arto KinnunenJarkko Paso
authored andcommitted
Update STM32 EMAC driver - limit RX frame length
DISCO_F769NI EMAC driver may return ethernet packet with illegal length when driver is under heavy load. In one case, the received bytes indicate frame length of 53 bytes but advertised data length was 65518 bytes. In another case EMAC driver variable `EthHandle.RxFrameInfos.length` contained value 0xFFFF FFFC. As a work-around accept only 1-1500 bytes long ethernet packets.
1 parent 067d7eb commit 6d2bc4f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

features/netsocket/emac-drivers/TARGET_STM/stm32xx_emac.cpp

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ int STM32_EMAC::low_level_input(emac_mem_buf_t **buf)
546546

547547
dmarxdesc = EthHandle.RxFrameInfos.FSRxDesc;
548548

549-
if (len > 0) {
549+
if (len > 0 && EthHandle.RxFrameInfos.length <= 1500) {
550550
/* Allocate a memory buffer chain from buffer pool */
551551
*buf = memory_manager->alloc_pool(len, 0);
552552
}

0 commit comments

Comments
 (0)