lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Re: [lwip] Memory leak and queued packets in etharp.c


From: Martin . Glunz
Subject: [lwip-users] Re: [lwip] Memory leak and queued packets in etharp.c
Date: Thu, 09 Jan 2003 00:09:25 -0000

Quoting address@hidden:

> 
> Hello Martin,
> 
> > There is another problem in etharp.c:
> > If a packet gets queued because an ARP request must be sent,
> > pbuf_ref() is called for this packet. This is ok so far, but
> > if the queued pbuf is chained, the chain may get lost later,
> > but before the packet is resent. I´ve fixed this in
> > pbuf_dechain() in pbuf.c.
> >
> I do not understand what you mean exactly.
> 
> Could you please describe a sequence of events that would
> trigger this bug to occur?
> 

I've noticed this when I tried to send UDP Packets using
netbuf_ref(). netbuf_ref() chains the referenced buffer
to the pbuf that contains the IP header. So the packet to
be sent consists of two chained pbufs. 
When netif_output() returns to the caller, this pbuf is
dechained and freed. The dechaining breaks the chain to
the real payload, so this won´t be sent when the packet
is resent, only the IP header is sent.

One of my first posts in this mailing list contains code
that triggers this bug:
http://www.sics.se/mailing-lists/lwip.html/msg01597.html
look at the lines between #else and #endif

The memory leak I mentioned there does not appear in the CVS version.

[This message was sent through the lwip discussion list.]




reply via email to

[Prev in Thread] Current Thread [Next in Thread]