]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
napatech: Close streams on hard errors
authorJeff Lucovsky <jeff.lucovsky@corelight.com>
Mon, 29 Jan 2024 18:39:40 +0000 (13:39 -0500)
committerVictor Julien <victor@inliniac.net>
Tue, 20 Feb 2024 12:51:24 +0000 (13:51 +0100)
Issue: 5172

This commit forces the current stream to be closed when a hard error
occurs.

Without this commit, a hard error will force a 2nd connection
the stream that raised the error.

With this commit, the stream with the hard error is closed before
opening another connection to the stream.

Verified with the Python snippet in the redmine issue.

src/source-napatech.c

index 54575d431e21a35cb0ce01af4f6deb1f195ac773..7036178ad1e85e481474d6bac2fd5f5d6a085930 100644 (file)
@@ -908,6 +908,7 @@ TmEcode NapatechPacketLoop(ThreadVars *tv, void *data, void *slot)
             NAPATECH_ERROR(status);
             SCLogInfo("Failed to read from Napatech Stream %d: %s",
                     ntv->stream_id, error_buffer);
+            NapatechStreamThreadDeinit(tv, ntv);
             break;
         }