aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--extras/mini-os/lwip-net.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/extras/mini-os/lwip-net.c b/extras/mini-os/lwip-net.c
index da4f1fd209..2e68279c6f 100644
--- a/extras/mini-os/lwip-net.c
+++ b/extras/mini-os/lwip-net.c
@@ -206,13 +206,16 @@ netfront_input(struct netif *netif, unsigned char* data, int len)
/* skip Ethernet header */
pbuf_header(p, -(s16)sizeof(struct eth_hdr));
/* pass to network layer */
- tcpip_input(p, netif);
+ if (tcpip_input(p, netif) == ERR_MEM)
+ /* Could not store it, drop */
+ pbuf_free(p);
break;
case ETHTYPE_ARP:
/* pass p to ARP module */
etharp_arp_input(netif, (struct eth_addr *) netif->hwaddr, p);
break;
+
default:
pbuf_free(p);
p = NULL;