[Top][All Lists]
[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: |
leon . woestenberg |
Subject: |
[lwip-users] Re: [lwip] Memory leak and queued packets in etharp.c |
Date: |
Wed, 08 Jan 2003 23:33:18 -0000 |
Hello,
> > Another issue is the queueing of packets that
> > are created by the user code with netbuf_ref().
> > This creates a chained pbuf with at least one
> > one element having the attribute PBUF_ROM.
> > There's a pending danger that the data part
> > of such a buffer gets overwritten by the
> > application before the queued packet is sent.
> > Should these be copied?
> The application must only overwrite that area when it's
> certain that it got sent.How it is to be notified I don't know.
> But the point of PBUF_ROM is to tell the stack not to copy so
> I think it shouldn't.
>
Very good mentioning this, as this is an outstanding issue not
yet resolved.
As you mention, two different approaches exist:
1) We need to find a way to notify the application that the
pbuf is sent. If possible, by return code. Too ugly would be
another callback IMHO.
2) Copy PBUF_ROM pbufs only when they are queued in the stack.
PBUF_ROM merely then would mean: "the data is constant and
available for lwIP during the call to a lwIP function. If lwIP\
references it afterwards, it must copy the pauload itself"
I would strongly opt for solution 2, unless someone else comes
up with an (even :-) more elegant solution.
Regards, Leon.
[This message was sent through the lwip discussion list.]
- [lwip-users] Re: [lwip] Memory leak and queued packets in etharp.c, Kieran Mansley, 2003/01/08
- [lwip-users] Re: [lwip] Memory leak and queued packets in etharp.c, Leon Woestenberg, 2003/01/08
- [lwip-users] Re: [lwip] Memory leak and queued packets in etharp.c, Nicolas Moreau, 2003/01/08
- [lwip-users] Re: [lwip] Memory leak and queued packets in etharp.c, Jani Monoses, 2003/01/08
- [lwip-users] Re: [lwip] Memory leak and queued packets in etharp.c,
leon . woestenberg <=
- [lwip-users] Re: [lwip] Memory leak and queued packets in etharp.c, Martin Glunz, 2003/01/09
- [lwip-users] Re: [lwip] Memory leak and queued packets in etharp.c, Leon Woestenberg, 2003/01/09
- [lwip-users] Re: [lwip] Memory leak and queued packets in etharp.c, Martin . Glunz, 2003/01/09
- [lwip-users] Re: [lwip] Memory leak and queued packets in etharp.c, Martin Glunz, 2003/01/09
- [lwip-users] Re: [lwip] Memory leak and queued packets in etharp.c, leon . woestenberg, 2003/01/09
- [lwip-users] Re: [lwip] Memory leak and queued packets in etharp.c, Adam Dunkels, 2003/01/09
- [lwip-users] Re: [lwip] Memory leak and queued packets in etharp.c, leon . woestenberg, 2003/01/09
- [lwip-users] Re: [lwip] Memory leak and queued packets in etharp.c, Jani Monoses, 2003/01/09
- [lwip-users] Re: [lwip] Memory leak and queued packets in etharp.c, Martin . Glunz, 2003/01/09
- [lwip-users] Re: [lwip] Memory leak and queued packets in etharp.c, leon . woestenberg, 2003/01/09