[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] mini-os: free dropped lwip packets



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1206467769 0
# Node ID 01686f69f48b229155b3f16848587fca330b5202
# Parent  a16f7a9f8ea272b40bb01694c8fd33a1bbe5fe43
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 <samuel.thibault@xxxxxxxxxxxxx>
---
 extras/mini-os/lwip-net.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletion(-)

diff -r a16f7a9f8ea2 -r 01686f69f48b extras/mini-os/lwip-net.c
--- a/extras/mini-os/lwip-net.c Tue Mar 25 17:55:39 2008 +0000
+++ b/extras/mini-os/lwip-net.c Tue Mar 25 17:56:09 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;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.