mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 10:08:20 +00:00
Allow offline packet sources to register FDs.
This commit is contained in:
parent
39c3bb797c
commit
26d3a81c09
2 changed files with 9 additions and 14 deletions
|
@ -182,10 +182,11 @@ void PcapSource::OpenOffline()
|
|||
return;
|
||||
}
|
||||
|
||||
props.selectable_fd = fileno(pcap_file(pd));
|
||||
|
||||
if ( props.selectable_fd < 0 )
|
||||
InternalError("OS does not support selectable pcap fd");
|
||||
// We don't register the file descriptor if we're in offline mode,
|
||||
// because libpcap's file descriptor for trace files isn't a reliable
|
||||
// way to know whether we actually have data to read.
|
||||
// See https://github.com/the-tcpdump-group/libpcap/issues/870
|
||||
props.selectable_fd = -1;
|
||||
|
||||
props.link_type = pcap_datalink(pd);
|
||||
props.is_live = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue