mirror of
https://github.com/zeek/zeek.git
synced 2025-10-07 09:08:20 +00:00
Fix PktSrc::Statistics returning bogus stats.
When reading from trace files, 'dropped' and 'link' fields are now just zeroed. When reading from an interface, the values filled in by pcap_stats() are now only used when that function indicates success. Closes #500.
This commit is contained in:
parent
c0c8b515f9
commit
d6d34f3a1f
3 changed files with 23 additions and 8 deletions
1
testing/btest/Baseline/bifs.net_stats_trace/output
Normal file
1
testing/btest/Baseline/bifs.net_stats_trace/output
Normal file
|
@ -0,0 +1 @@
|
|||
[pkts_recvd=131, pkts_dropped=0, pkts_link=0]
|
8
testing/btest/bifs/net_stats_trace.test
Normal file
8
testing/btest/bifs/net_stats_trace.test
Normal file
|
@ -0,0 +1,8 @@
|
|||
# Checks that accurate stats are returned when reading from a trace file.
|
||||
# @TEST-EXEC: bro -r $TRACES/wikipedia.trace >output %INPUT
|
||||
# @TEST-EXEC: btest-diff output
|
||||
|
||||
event bro_done()
|
||||
{
|
||||
print net_stats();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue