detect long IPv4 header
@@ -1808,6 +1808,7 @@ return;
void processipv4packet(uint32_t tv_sec, uint32_t tv_usec, uint32_t caplen, uint8_t *packet)
{
ipv4_t *ipv4;
+uint32_t ipv4len;
//uint8_t *packet_ptr;
if(caplen < (uint32_t)IPV4_SIZE_MIN)
@@ -1819,6 +1820,11 @@ if((ipv4->ver_hlen & 0xf0) != 0x40)
{
return;
}
+ipv4len = (ipv4->ver_hlen && 0x0f) *4;
+if(caplen < (uint32_t)ipv4len)
+ {
+ return;
+ }
if(ipv4->nextprotocol == NEXTHDR_TCP)
{
