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.
pull/12457/head
Arto Kinnunen 2020-02-18 14:40:58 +02:00
parent c520449e2d
commit 6a410f89eb
1 changed files with 1 additions and 1 deletions

View File

@ -540,7 +540,7 @@ int STM32_EMAC::low_level_input(emac_mem_buf_t **buf)
dmarxdesc = EthHandle.RxFrameInfos.FSRxDesc;
if (len > 0) {
if (len > 0 && EthHandle.RxFrameInfos.length <= 1500) {
/* Allocate a memory buffer chain from buffer pool */
*buf = memory_manager->alloc_pool(len, 0);
}