]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
threads/time: rename ts to pktts to make purpose clear
authorVictor Julien <victor@inliniac.net>
Fri, 28 Feb 2020 12:06:09 +0000 (13:06 +0100)
committerJeff Lucovsky <jeff@lucovsky.org>
Sun, 5 Apr 2020 19:11:25 +0000 (15:11 -0400)
(cherry picked from commit b60520503247f31c9c58157f67d2f901cfb23d93)

src/tm-threads.c

index 2656891df2d24a68961246769f04be71d12cc744..a36de222a5ab480cfb84554677c91f27cc793604 100644 (file)
@@ -2271,7 +2271,8 @@ typedef struct Thread_ {
     int type;
     int in_use;         /**< bool to indicate this is in use */
 
-    struct timeval ts;  /**< current time of this thread (offline mode) */
+    struct timeval pktts;   /**< current packet time of this thread
+                             *   (offline mode) */
 } Thread;
 
 typedef struct Threads_ {
@@ -2399,7 +2400,7 @@ void TmThreadsSetThreadTimestamp(const int id, const struct timeval *ts)
 
     int idx = id - 1;
     Thread *t = &thread_store.threads[idx];
-    COPY_TIMESTAMP(ts, &t->ts);
+    COPY_TIMESTAMP(ts, &t->pktts);
     SCMutexUnlock(&thread_store_lock);
 }
 
@@ -2410,7 +2411,7 @@ void TmThreadsInitThreadsTimestamp(const struct timeval *ts)
         Thread *t = &thread_store.threads[s];
         if (!t->in_use)
             break;
-        COPY_TIMESTAMP(ts, &t->ts);
+        COPY_TIMESTAMP(ts, &t->pktts);
     }
     SCMutexUnlock(&thread_store_lock);
 }
@@ -2428,14 +2429,14 @@ void TmThreadsGetMinimalTimestamp(struct timeval *ts)
         Thread *t = &thread_store.threads[s];
         if (t == NULL || t->in_use == 0)
             continue;
-        if (!(timercmp(&t->ts, &nullts, ==))) {
+        if (!(timercmp(&t->pktts, &nullts, ==))) {
             if (!set) {
-                local.tv_sec = t->ts.tv_sec;
-                local.tv_usec = t->ts.tv_usec;
+                local.tv_sec = t->pktts.tv_sec;
+                local.tv_usec = t->pktts.tv_usec;
                 set = 1;
             } else {
-                if (timercmp(&t->ts, &local, <)) {
-                    COPY_TIMESTAMP(&t->ts, &local);
+                if (timercmp(&t->pktts, &local, <)) {
+                    COPY_TIMESTAMP(&t->pktts, &local);
                 }
             }
         }