Merge remote-tracking branch

* Prevent IP fragment reassembly on packets without minimal IP header
This commit is contained in:
Jon Siwek 2020-06-09 09:39:31 -07:00
commit 3255930738
3 changed files with 59 additions and 1 deletions

View file

@ -248,6 +248,23 @@ void NetSessions::DoNextPacket(double t, const Packet* pkt, const IP_Hdr* ip_hdr
return;
}
if ( ip_hdr->IP4_Hdr() )
{
if ( ip_hdr_len < sizeof(struct ip) )
{
Weird("IPv4_min_header_size", pkt);
return;
}
}
else
{
if ( ip_hdr_len < sizeof(struct ip6_hdr) )
{
Weird("IPv6_min_header_size", pkt);
return;
}
}
// Ignore if packet matches packet filter.
if ( packet_filter && packet_filter->Match(ip_hdr, len, caplen) )
return;