]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
flow-bypass: fix timeout of maps bypassed flows
authorEric Leblond <eric@regit.org>
Tue, 5 Mar 2019 22:54:36 +0000 (23:54 +0100)
committerVictor Julien <victor@inliniac.net>
Tue, 18 Jun 2019 05:07:02 +0000 (07:07 +0200)
The time is taken from the parameter and is checked against real
flow entries so we need a standard time.

src/flow-bypass.c

index 3debd48225b798549a9e04f80f06c38168c4bd85..23bc8b99a74afd01c826ddf9b230ff8b2de0a941 100644 (file)
@@ -63,7 +63,7 @@ static TmEcode BypassedFlowManager(ThreadVars *th_v, void *thread_data)
     BypassedFlowManagerThreadData *ftd = thread_data;
     struct timespec curtime = {0, 0};
 
-    if (clock_gettime(CLOCK_MONOTONIC, &curtime) != 0) {
+    if (clock_gettime(CLOCK_REALTIME, &curtime) != 0) {
         SCLogWarning(SC_ERR_INVALID_VALUE, "Can't get time: %s (%d)",
                 strerror(errno), errno);
     }
@@ -75,7 +75,7 @@ static TmEcode BypassedFlowManager(ThreadVars *th_v, void *thread_data)
 
     while (1) {
         SCLogDebug("Dumping the table");
-        if (clock_gettime(CLOCK_MONOTONIC, &curtime) != 0) {
+        if (clock_gettime(CLOCK_REALTIME, &curtime) != 0) {
             SCLogWarning(SC_ERR_INVALID_VALUE, "Can't get time: %s (%d)",
                          strerror(errno), errno);
             usleep(10000);