]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
pcap: handle failure of packet treatment
authorEric Leblond <eric@regit.org>
Sat, 11 Aug 2012 09:43:18 +0000 (11:43 +0200)
committerEric Leblond <eric@regit.org>
Mon, 27 Aug 2012 09:43:53 +0000 (11:43 +0200)
If the loop is breaked, this means we've got a treatment error. We
don't need to reconnect but we must exit with correct status.

src/source-pcap.c

index 7bf537d14254689a3d33e9cae0056d453e54b2c9..0843322ef8a9a7fe07367550a3dc65f72ee54151 100644 (file)
@@ -287,6 +287,9 @@ TmEcode ReceivePcapLoop(ThreadVars *tv, void *data, void *slot)
             int dbreak = 0;
             SCLogError(SC_ERR_PCAP_DISPATCH, "error code %" PRId32 " %s",
                        r, pcap_geterr(ptv->pcap_handle));
+            if (r == PCAP_ERROR_BREAK) {
+                SCReturnInt(ptv->cb_result);
+            }
             do {
                 usleep(PCAP_RECONNECT_TIMEOUT);
                 if (suricata_ctl_flags != 0) {