Merge remote-tracking branch 'origin/topic/timw/fix-ip-header-length-checking'

* origin/topic/timw/fix-ip-header-length-checking:
  Fix handling of IP packets with bogus IP header lengths
This commit is contained in:
Tim Wojtulewicz 2021-06-04 08:28:57 -07:00
commit d15fca7e17
5 changed files with 24 additions and 1 deletions

View file

@ -235,6 +235,13 @@ bool IPAnalyzer::AnalyzePacket(size_t len, const uint8_t* data, Packet* packet)
packet->proto = proto;
// Double check the lengths one more time before forwarding this on.
if ( packet->ip_hdr->TotalLen() < packet->ip_hdr->HdrLen() )
{
Weird("bogus_IP_header_lengths", packet);
return false;
}
switch ( proto ) {
case IPPROTO_NONE:
// If the packet is encapsulated in Teredo, then it was a bubble and