lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Incoming packet bigger than PBUF_POOL_BUFSIZE


From: Simon Goldschmidt
Subject: Re: [lwip-users] Incoming packet bigger than PBUF_POOL_BUFSIZE
Date: Fri, 9 Dec 2011 15:35:54 +0100

Gary Spivey <address@hidden> wrote:

>    if (bufsize) 
>    {
>      // Allocate a chain of pbufs big enough to hold it
>      p = pbuf_alloc(PBUF_RAW,  bufsize, PBUF_POOL);
>      // Set up our linked-list index
>      chainp = p;
>      // Now let's copy the data into our chain
>      while (bufsize)
>      {
>        // Don't read more than one buffer at a time
>        bytes_to_read = MINIMUM(bufsize, PBUF_POOL_BUFSIZE);

The last line is wrong: use 'chainp->len' instead of PBUF_POOL_BUFSIZE. The two 
are not always equal.

Simon


reply via email to

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