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 11:08:00 +0200
> > /* Check minimum length (IP header
+ UDP header)
> > * and move payload pointer to UDP header */
> > if (p->tot_len < (IPH_HL(iphdr) * 4 + UDP_HLEN)
|| pbuf_header(p, -
> > (s16_t)(IPH_HL(iphdr) * 4))) {
> >
> >
> > 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?
I'm thinking of applying this attached patch to UDP,
ICMP, IGMP, and TCP.
I've changed to checks size _before_ call to pbuf_header,
and also use "len" instead of "tot_len".