From ec4a7be5c2540207042669e10cc4134e108dae02 Mon Sep 17 00:00:00 2001 From: Bazooka Joe Date: Mon, 16 Sep 2019 13:52:56 +0000 Subject: [PATCH] Merged in BazookaJoe1900/nuttx/pr-network_stm32_freebuffer (pull request #1030) Large ethernet packet can leads network halt Approved-by: Gregory Nutt --- arch/arm/src/stm32f7/stm32_ethernet.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/arch/arm/src/stm32f7/stm32_ethernet.c b/arch/arm/src/stm32f7/stm32_ethernet.c index ed733b6b5a..fbfe2a679c 100644 --- a/arch/arm/src/stm32f7/stm32_ethernet.c +++ b/arch/arm/src/stm32f7/stm32_ethernet.c @@ -1796,7 +1796,17 @@ static void stm32_receive(struct stm32_ethmac_s *priv) if (dev->d_len > CONFIG_NET_ETH_PKTSIZE) { - nwarn("WARNING: DROPPED Too big: %d\n", dev->d_len); + nerr("ERROR: Dropped, Too big: %d\n", dev->d_len); + + /* Free dropped packet buffer */ + + if (dev->d_buf) + { + stm32_freebuffer(priv, dev->d_buf); + dev->d_buf = NULL; + dev->d_len = 0; + } + continue; }