]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
napatech: Check for out-of-band control operations
authorJeff Lucovsky <jeff@lucovsky.org>
Fri, 24 Apr 2020 14:28:32 +0000 (10:28 -0400)
committerVictor Julien <victor@inliniac.net>
Sat, 25 Apr 2020 06:01:46 +0000 (08:01 +0200)
This commit causes the packet source to check for out of band control
operations when there are no packets immediately available.

src/source-napatech.c

index c944c8672c3fdb0a2e144492d5730e2ce761d873..f84482d5f2aeabf56cf8fbcaf81edc81e9a95d16 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2017 Open Information Security Foundation
+/* Copyright (C) 2012-2020 Open Information Security Foundation
  *
  * You can copy, redistribute or modify this Program under the terms of
  * the GNU General Public License version 2 as published by the Free
@@ -885,6 +885,9 @@ TmEcode NapatechPacketLoop(ThreadVars *tv, void *data, void *slot)
         status = NT_NetRxGet(ntv->rx_stream, &packet_buffer, 1000);
         if (unlikely(
                 status == NT_STATUS_TIMEOUT || status == NT_STATUS_TRYAGAIN)) {
+            if (status == NT_STATUS_TIMEOUT) {
+                TmThreadsCaptureHandleTimeout(tv, ntv->slot, NULL);
+            }
             continue;
         } else if (unlikely(status != NT_SUCCESS)) {
             NAPATECH_ERROR(SC_ERR_NAPATECH_OPEN_FAILED, status);