-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get initial network_time in 3.1 #938
Comments
Flagging this as a bug since it seems like a regression. |
That's correct. The new timer architecture would wake the loop up immediately for that zero-second timer and fire the event before anything else was processed.
I don't know of one off the top of my head that exists already but I'll look around. It'd be easy enough to add a new one. |
How are you running it, out of curiosity? I'm getting the same result on both 3.0 and
I tried the same without |
Sorry, I forgot to mention that this only occurs when reading a PCAP. I think in case of live captures, zeek takes another path. |
I wrote a test case and added a new event in #943. Playing around with the test I noticed that |
Writing the comment I noticed my mistake. As stated in the docs, the event is executed together with the first packet as it has been scheduled when network_time is 0 and thus the timer expires immediately. Assuming we don't look at PCAPs with 0 timestamps, one could use that to schedule an event when network time is initialized. This way we wouldn't need a new event. |
I like the idea of adding an explicit event for first time A quick hack/PoC that restores old behavior: b6756a5 |
When processing PCAPs, network time might significantly differ from current time. As already documented,
network_time()
is not yet initialized inzeek_init()
. To get network time before any packet is processed, one could schedule an event with 0sec:With version 3.1 this approach stopped working for me.
pcap_init()
is executed before network time is set. I guess this is a side effect of the changes to the IO loop and the timer manager. One solution might be to introduce a new event (in case there isn't already one I missed) after network time is initialized but before the first packet is processed.The text was updated successfully, but these errors were encountered: