diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2008-03-25 17:56:09 +0000 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2008-03-25 17:56:09 +0000 |
commit | 587ab24ee4666af2cc3a5b5215e876b74a7d19fe (patch) | |
tree | 641695e117186b5e97a73be1ed04cb7c0a887cb5 /extras/mini-os/lwip-net.c | |
parent | 798780cf11a892e3eaac207794a12bff23ddb598 (diff) | |
download | xen-587ab24ee4666af2cc3a5b5215e876b74a7d19fe.tar.gz xen-587ab24ee4666af2cc3a5b5215e876b74a7d19fe.tar.bz2 xen-587ab24ee4666af2cc3a5b5215e876b74a7d19fe.zip |
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>
Diffstat (limited to 'extras/mini-os/lwip-net.c')
-rw-r--r-- | extras/mini-os/lwip-net.c | 5 |
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; |