diff options
author | Hanoh Haim <hhaim@cisco.com> | 2015-09-17 21:44:53 +0300 |
---|---|---|
committer | Hanoh Haim <hhaim@cisco.com> | 2015-09-17 21:44:53 +0300 |
commit | f885ac59cebcf1e87b97b0e6ef6e9eb032f9f733 (patch) | |
tree | f577368cb65bc537a85c1b7c4111618d84984318 /src/bp_sim.cpp | |
parent | a360a1734c459d62bd4c204a6005214ce8944f85 (diff) |
fix some pcap load issues
Diffstat (limited to 'src/bp_sim.cpp')
-rwxr-xr-x | src/bp_sim.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/bp_sim.cpp b/src/bp_sim.cpp index 555696f1..8a8bc5f9 100755 --- a/src/bp_sim.cpp +++ b/src/bp_sim.cpp @@ -1148,13 +1148,6 @@ void CPacketIndication::ProcessIpPacket(CPacketParser *parser, } offset += ip_header_length; - if (!l3.m_ipv4->isChecksumOK() ){ - m_cnt->m_ip_checksum_error++; - } - if( l3.m_ipv4->isMulticast() ){ - m_cnt->m_ip_multicast_error++; - return; - } if( l3.m_ipv4->getTimeToLive() ==0 ){ m_cnt->m_ip_ttl_is_zero_error++; @@ -1177,10 +1170,19 @@ void CPacketIndication::ProcessIpPacket(CPacketParser *parser, return; } + if ( m_packet->pkt_len > MAX_BUF_SIZE -FIRST_PKT_SIZE ){ + m_cnt->m_tcp_udp_pkt_length_error++; + printf("ERROR packet is too big, not supported jumbo packets that larger than %d \n",MAX_BUF_SIZE); + return; + } + // Set packet length and include padding if needed m_packet->pkt_len = l3.m_ipv4->getTotalLength() + getIpOffset(); if (m_packet->pkt_len < 60) { m_packet->pkt_len = 60; } + + + m_cnt->m_valid_udp_tcp++; m_payload_len = l3.m_ipv4->getTotalLength() - (payload_offset_from_ip); m_payload = (uint8_t *)(packetBase +offset); |