All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mini-os: free dropped lwip packets
@ 2008-03-25 17:08 Samuel Thibault
  0 siblings, 0 replies; only message in thread
From: Samuel Thibault @ 2008-03-25 17:08 UTC (permalink / raw)
  To: xen-devel

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@eu.citrix.com>

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;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-03-25 17:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-25 17:08 [PATCH] mini-os: free dropped lwip packets Samuel Thibault

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.