Actions
Bug #6584
closedSCTIME_ADD_SECS() macro zeros out ts.usec part
Affected Versions:
Effort:
low
Difficulty:
low
Label:
Beginner, C
Description
The SCTIME_* macros may need some review.
Napatech's PR https://github.com/OISF/suricata/pull/9833 fixes SCTIME_ADD_USECS(), however there are other issues. Currently the SCTIME_ADD_SECS(ts, s) macro adds s seconds to ts.secs and clears ts.usecs.
I would argue that SCTIME_ADD_SECS(ts, s) should return ts.usecs unmodified, otherwise one integer second is not added to ts.
E.g. currently ts.secs = 10, ts.usecs = 999999, s = 1, results in ts.secs = 11, ts.usecs = 0. Only 1 microsecond is added to ts.
This bug could affect various time related operations such as fragment reassembly, detection engine thresholds etc.
Actions