From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Thibault Subject: [PATCH] mini-os: free dropped lwip packets Date: Tue, 25 Mar 2008 17:08:02 +0000 Message-ID: <20080325170802.GB6845@implementation.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org 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 diff -r be3025f6af2e extras/mini-os/lwip-net.c --- a/extras/mini-os/lwip-net.c Mon Mar 24 18:24:03 2008 +0000 +++ b/extras/mini-os/lwip-net.c Tue Mar 25 17:05:53 2008 +0000 @@ -206,13 +206,16 @@ netfront_input(struct netif *netif, unsi /* 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;