mirror of https://github.com/ARMmbed/mbed-os.git
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
parent
c520449e2d
commit
6a410f89eb
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue