diff --git a/net/lwip/src/netif/ethernetif.c b/net/lwip/src/netif/ethernetif.c index 45eb9df12..f8d449856 100644 --- a/net/lwip/src/netif/ethernetif.c +++ b/net/lwip/src/netif/ethernetif.c @@ -64,7 +64,11 @@ err_t eth_input(struct pbuf *p, struct netif *inp) case ETHTYPE_IP: etharp_ip_input(inp, p); pbuf_header(p, -((rt_int16_t)sizeof(struct eth_hdr))); - tcpip_input(p, inp); + if (tcpip_input(p, inp) != ERR_OK) + { + /* discard packet */ + pbuf_free(p); + } break; case ETHTYPE_ARP: