[Top][All Lists]

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

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

From: Fredrik Hederstierna
Subject: Re: [lwip-devel] Problem with LWIP_ERROR in pbuf_header(..)
Date: Tue, 28 Apr 2009 08:45:33 +0200

> > 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 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 2
#define MEMP_NUM_UDP_PCB 3

#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
reply via email to

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