From 587ab24ee4666af2cc3a5b5215e876b74a7d19fe Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Tue, 25 Mar 2008 17:56:09 +0000 Subject: mini-os: free dropped lwip packets When lwIP can not accept a packet, it is up to us to free it. Signed-off-by: Samuel Thibault --- extras/mini-os/lwip-net.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'extras/mini-os/lwip-net.c') 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; -- cgit v1.2.3