diff options
-rwxr-xr-x | src/common/pcap.cpp | 6 | ||||
-rw-r--r-- | src/publisher/trex_publisher.cpp | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/common/pcap.cpp b/src/common/pcap.cpp index a68fb620..8e9bf0ac 100755 --- a/src/common/pcap.cpp +++ b/src/common/pcap.cpp @@ -154,18 +154,18 @@ bool LibPCapReader::ReadPacket(CCapPktRaw *lpPacket) if (m_is_flip) { flip(&pkt_header); } - if (pkt_header.len > READER_MAX_PACKET_SIZE) { + if (pkt_header.caplen > READER_MAX_PACKET_SIZE) { /* cannot read this packet */ //printf("ERROR packet is too big, bigger than %d \n",READER_MAX_PACKET_SIZE); return false; } - lpPacket->pkt_len = fread(lpPacket->raw,1,pkt_header.len,m_file_handler); + lpPacket->pkt_len = fread(lpPacket->raw,1,pkt_header.caplen,m_file_handler); lpPacket->time_sec = pkt_header.ts.sec; lpPacket->time_nsec = pkt_header.ts.msec*1000; - if ( lpPacket->pkt_len < pkt_header.len) { + if ( lpPacket->pkt_len < pkt_header.caplen) { lpPacket->pkt_len = 0; return false; } diff --git a/src/publisher/trex_publisher.cpp b/src/publisher/trex_publisher.cpp index 850b5955..67670593 100644 --- a/src/publisher/trex_publisher.cpp +++ b/src/publisher/trex_publisher.cpp @@ -77,7 +77,7 @@ void TrexPublisher::publish_json(const std::string &s, uint32_t zip_threshold){ if (m_publisher) { - if ( (zip_threshold > 0) && (s.size() > zip_threshold) ) { + if ( (zip_threshold != 0) && (s.size() > zip_threshold) ) { publish_zipped_json(s); } else { publish_raw_json(s); |