> > 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