From eaea832a4e1033276a6787ef14ccbe66fbe3d1b4 Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Sat, 11 Aug 2012 11:43:18 +0200 Subject: [PATCH] pcap: handle failure of packet treatment 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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/source-pcap.c b/src/source-pcap.c index 7bf537d142..0843322ef8 100644 --- a/src/source-pcap.c +++ b/src/source-pcap.c @@ -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) {