[Top][All Lists]

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

[lwip-users] UDP pbuf->next problem?

From: Daniel Berenguer
Subject: [lwip-users] UDP pbuf->next problem?
Date: Thu, 15 Apr 2010 11:07:02 +0200

lwIP version: 1.3.0

I have an application running on a LM3S8692, with Luminary's web
server and UDP. Everything works fine until the reception of a
segmented UDP packet (p->len < p->tot_len). Then, once I do p->next,
the web server stops working and UDP sometimes fails too. Pings
continue working though. This is the critical piece of my code:

memcpy(myBuf, p->payload, p->len);
bufLen += p->len;

// Commenting this block avoids the problem
while((p->len != p->tot_len) && (p->next != NULL))
        p = p->next;
        memcpy(myBuf+bufLen , p->payload, p->len);
        bufLen += p->len;

myBuf[bufLen] = 0;

The inbound UDP packets are not really large (size < 400 bytes) and I
don't know how to enable larger pbufs so that I could read packets in
a single pass. This would prevent me from doing p->next. I know this
is not an elegant solution but my application could work properly at
least (I guess). How can I increase the size of pbufs? Any other

Thank you very much for your help.


reply via email to

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