[Top][All Lists]

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

Re: [lwip-users] p->payload == iphdr failed...

From: Jonathan Larmour
Subject: Re: [lwip-users] p->payload == iphdr failed...
Date: Fri, 07 Nov 2008 11:41:12 +0000
User-agent: Thunderbird (X11/20070530)

Ed Sutter wrote:
> To be more efficient, I changed this by using PBUF_REF and
> setting the payload pointer to the packet buffer...
>     ....
>     len = mon_recvenetpkt((char *)ipacket,sizeof(ipacket));
>     if (len) {
>         p = pbuf_alloc(PBUF_RAW, len, PBUF_REF);
>         if (p) {
>             p->payload = ipacket;
>             ethernet_input(p, mynetifp);
>     ....
> This new code works ok with incoming expected packets.
> The original code doesn't cause the assertion error above.
> Is the "new" code above incorrect?

What frees ipacket's memory? Is there any chance that memory can be reused
before the pbuf is freed?

You may also need to consider the alignment of ipacket.

eCosCentric Limited      http://www.eCosCentric.com/     The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.       Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
------["Si fractum non sit, noli id reficere"]------       Opinions==mine

reply via email to

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