Skip to content

Commit

Permalink
Fix for traffic with TCP segmentation offloading with IP header len f…
Browse files Browse the repository at this point in the history
…ield being set to zero.
  • Loading branch information
Seth Hall committed Jan 9, 2014
1 parent cb31f9f commit 28673bd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Sessions.cc
Expand Up @@ -384,6 +384,15 @@ void NetSessions::DoNextPacket(double t, const struct pcap_pkthdr* hdr,
const struct ip* ip4 = ip_hdr->IP4_Hdr();

uint32 len = ip_hdr->TotalLen();
if ( len == 0 )
{
// TCP segmentation offloading can zero out the ip_len field.
Weird("ip_hdr_len_zero", hdr, pkt, encapsulation);

// Cope with the zero'd out ip_len field by using the caplen.
len = hdr->caplen - hdr_size;
}

if ( hdr->len < len + hdr_size )
{
Weird("truncated_IP", hdr, pkt, encapsulation);
Expand Down

0 comments on commit 28673bd

Please sign in to comment.