]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
ipfw: fix operator error in test
authorEric Leblond <eric@regit.org>
Thu, 27 Feb 2014 17:39:07 +0000 (18:39 +0100)
committerVictor Julien <victor@inliniac.net>
Mon, 3 Mar 2014 09:14:36 +0000 (10:14 +0100)
Fix warning spotted by clang on FreeBSD:

source-ipfw.c:241:49: warning: use of logical '||' with constant operand [-Wconstant-logical-operand]
        if (suricata_ctl_flags & (SURICATA_STOP || SURICATA_KILL)) {
                                                ^  ~~~~~~~~~~~~~
source-ipfw.c:241:49: note: use '|' for a bitwise operation
        if (suricata_ctl_flags & (SURICATA_STOP || SURICATA_KILL)) {
                                                ^~
                                                |

Use same logic as the one used in other capture mode.

src/source-ipfw.c

index 0195d09550a218a7fd25ce984a1070522cf86598..cfe24bf94a94bdb77279f3c4fa863f0fb66bf5f5 100644 (file)
@@ -238,7 +238,7 @@ TmEcode ReceiveIPFWLoop(ThreadVars *tv, void *data, void *slot)
     SCLogInfo("Thread '%s' will run on port %d (item %d)",
               tv->name, nq->port_num, ptv->ipfw_index);
     while (1) {
-        if (suricata_ctl_flags & (SURICATA_STOP || SURICATA_KILL)) {
+        if (unlikely(suricata_ctl_flags != 0)) {
             SCReturnInt(TM_ECODE_OK);
         }