mirror of https://github.com/OISF/suricata
pcap-file: fix poll-interval being misinterpreted as a timestamp
The passed poll-interval should determine how many seconds to wait in-between polls. The previous code passed the value through localtime function which understood the input integer as an epoch time and converted it to time structure, of which only seconds were kept. This kind of worked for sub-60 values but wrapped for values 60+ to the usual seconds range 0-59. Additionally, setting poll-interval to 60 made it a busy loop with no sleep between polls. With intervals of 60+ seconds now honored, a single sleep blocked the shutdown (or a unix socket pcap-interrupt) until the interval elapsed, and the engine was killed after the 60 second receive thread shutdown timeout. The wait is now done in one second steps, checking the run status in-between. Ticket: 9129pull/16497/head
parent
fc96a9f69e
commit
4488424129
Loading…
Reference in New Issue