mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Compare pcap_next_ex() result to PCAP_ERROR/PCAP_ERROR_BREAK
This commit is contained in:
parent
2000e2a424
commit
65ae4d732a
1 changed files with 2 additions and 2 deletions
|
@ -202,12 +202,12 @@ bool PcapSource::ExtractNextPacket(Packet* pkt)
|
|||
int res = pcap_next_ex(pd, &header, &data);
|
||||
|
||||
switch ( res ) {
|
||||
case -2:
|
||||
case PCAP_ERROR_BREAK: // -2
|
||||
// Exhausted pcap file, no more packets to read.
|
||||
assert(! props.is_live);
|
||||
Close();
|
||||
return false;
|
||||
case -1:
|
||||
case PCAP_ERROR: // -1
|
||||
// Error occurred while reading the packet.
|
||||
if ( props.is_live )
|
||||
reporter->Error("failed to read a packet from %s: %s",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue