mirror of
https://github.com/zeek/zeek.git
synced 2025-10-13 03:58:20 +00:00
Fix table expiry for values assigned in bro_init() when reading live.
Value assigned in bro_init() to a table with &create_expire weren't expiring when reading traffic from an interface. It worked when reading a pcap file, but I added a test case to show it still working.
This commit is contained in:
parent
f25e2252f9
commit
fcd8f9b77e
4 changed files with 413 additions and 4 deletions
|
@ -2136,10 +2136,13 @@ void TableVal::DoExpire(double t)
|
|||
(v = tbl->NextEntry(k, expire_cookie)); ++i )
|
||||
{
|
||||
if ( v->ExpireAccessTime() == 0 )
|
||||
{
|
||||
// This happens when we insert val while network_time
|
||||
// hasn't been initialized yet (e.g. in bro_init()).
|
||||
// We correct the timestamp now.
|
||||
v->SetExpireAccess(network_time);
|
||||
// hasn't been initialized yet (e.g. in bro_init()), and
|
||||
// also when bro_start_network_time hasn't been initialized
|
||||
// (e.g. before first packet). The expire_access_time is
|
||||
// correct, so we just need to wait.
|
||||
}
|
||||
|
||||
else if ( v->ExpireAccessTime() + expire_time < t )
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue