Project

General

Profile

Actions

Bug #6584

closed
SD SD

src: SCTIME_ADD_SECS() macro zeros out ts.usec part

Bug #6584: src: SCTIME_ADD_SECS() macro zeros out ts.usec part

Added by Stephen Donnelly over 2 years ago. Updated 12 months ago.

Status:
Closed
Priority:
Normal
Target version:
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.


Subtasks 1 (0 open1 closed)

Bug #6596: SCTIME_ADD_SECS() macro zeros out ts.usec part (7.0.x backport)ClosedJeff LucovskyActions

Related issues 1 (0 open1 closed)

Related to Suricata - Bug #6585: src: SCTIME_FROM_TIMESPEC() creates incorrect timestampsClosedStephen DonnellyActions

VJ Updated by Victor Julien over 2 years ago Actions #1

  • Related to Bug #6585: src: SCTIME_FROM_TIMESPEC() creates incorrect timestamps added

VJ Updated by Victor Julien over 2 years ago Actions #2

  • Target version changed from TBD to 7.0.3

VJ Updated by Victor Julien over 2 years ago Actions #3

  • Target version changed from 7.0.3 to 8.0.0-beta1

JL Updated by Jeff Lucovsky over 2 years ago Actions #4

  • Status changed from New to In Review
  • Assignee changed from OISF Dev to Jeff Lucovsky

OT Updated by OISF Ticketbot over 2 years ago Actions #6

  • Subtask #6596 added

OT Updated by OISF Ticketbot over 2 years ago Actions #7

  • Label deleted (Needs backport to 7.0)

VJ Updated by Victor Julien over 2 years ago Actions #8

  • Assignee changed from Jeff Lucovsky to Stephen Donnelly

JL Updated by Jeff Lucovsky over 2 years ago Actions #9

  • Status changed from In Review to Resolved

JL Updated by Jeff Lucovsky over 2 years ago Actions #10

  • Status changed from Resolved to Closed

VJ Updated by Victor Julien 12 months ago Actions #11

  • Subject changed from SCTIME_ADD_SECS() macro zeros out ts.usec part to src: SCTIME_ADD_SECS() macro zeros out ts.usec part
Actions

Also available in: PDF Atom