Check the IP version field first !
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Implement comm-info and dedicated-interface-addr feature, for
benefit of hippotat.
* Implement `keepalive' site option, to try to keep link always up.
+ * When printing messages about dropping IPv6, do not print anything
+ about ihl. (Check the IP version field first!)
--
struct iphdr *iph=(struct iphdr *)buf->start;
int32_t len;
- if (iph->ihl < 5) BAD("ihl %u",iph->ihl);
if (iph->version != 4) BAD("version %u",iph->version);
+ if (iph->ihl < 5) BAD("ihl %u",iph->ihl);
if (buf->size < iph->ihl*4) BAD("size %"PRId32"<%u*4",buf->size,iph->ihl);
if (ip_fast_csum((uint8_t *)iph, iph->ihl)!=0) BAD("csum");
len=ntohs(iph->tot_len);