lwip-devel
[Top][All Lists]
Advanced

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

Re: [lwip-devel] Problem with LWIP_ERROR in pbuf_header(..)


From: address@hidden
Subject: Re: [lwip-devel] Problem with LWIP_ERROR in pbuf_header(..)
Date: Tue, 28 Apr 2009 18:30:35 +0200
User-agent: Thunderbird 2.0.0.21 (Macintosh/20090302)

To get a decent throughput you should definitvely increase some of the configuration options (mainly PBUF_POOL_SIZE, and MEM_SIZE).

The option that changes the length of the pbuf-pool buffers is not in your list, although that's the most interesting one for your problem (the assert): Can you tell us what PBUF_POOL_BUFSIZE is set to?

If you didn't configure that option an build with the default in opt.h, it should be big enough to get a full TCP segment (including data) in it, so enough also for all other protocols.

Simon


Fredrik Hederstierna wrote:

> > That is if incomming UDP packet is too short, so the call to
> > pbuf_header() will trig LWIP_ERROR?
> > Isn't it better to just drop illegal-size packets instead of ASSERT?
> > What if header and header length is corrupted?
>
> In the case you mention, shouldn't the first clause in the if statement
> "if (p->tot_len < (IPH_HL(iphdr) * 4 + UDP_HLEN)"  protect us from the
> assertion?  I.e. if the packet is short it should do that clause, but
> then not the pbuf_header() call.
>
> Also, it's a good idea subscribe to lwip-devel to make sure you see
> replies to your questions.  I've CC'd you as I noticed in this case that
> you're not subscribed, but I don't always realise!

About configure lwIP correct:

How can we protect us from incoming packets with malformed headers or too large headers?

We config lwIP like this


*#define* LWIP_RAW 0
*#define* LWIP_DHCP 1

*#define* IP_REASSEMBLY 0

*#define* ARP_QUEUEING 1

*#define* ARP_TABLE_SIZE 4

*#define* PBUF_POOL_SIZE 10

*#define* MEMP_NUM_PBUF 10
*#define* MEMP_NUM_TCP_SEG 8
*#define* MEMP_NUM_TCP_PCB_LISTEN 1
*#define* MEMP_NUM_TCP_PCB 2
*#define* MEMP_NUM_UDP_PCB 3
*#define* MEMP_NUM_SYS_TIMEOUT 5

*#define* MEM_SIZE 1500


Should we use larger PBUF_POOL_SIZE ? But how can we be sure that it will work for all types of connections?
Should we use larger HEAP size?
Or if we get unexpected or malformed headers/packets?

Best Regards
/Fredrik
------------------------------------------------------------------------

_______________________________________________
lwip-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-devel





reply via email to

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