Skip to content

Commit 6a410f8

Browse files
author
Arto Kinnunen
committed
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 c520449 commit 6a410f8

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
@@ -540,7 +540,7 @@ int STM32_EMAC::low_level_input(emac_mem_buf_t **buf)
540540

541541
dmarxdesc = EthHandle.RxFrameInfos.FSRxDesc;
542542

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

0 commit comments

Comments
 (0)