From: Eric Leblond Date: Thu, 27 Feb 2014 17:39:07 +0000 (+0100) Subject: ipfw: fix operator error in test X-Git-Tag: suricata-2.0rc2~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=941cfe16419d3c4a9fd09610c012b6cc896e912c;p=thirdparty%2Fsuricata.git ipfw: fix operator error in test 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. --- diff --git a/src/source-ipfw.c b/src/source-ipfw.c index 0195d09550..cfe24bf94a 100644 --- a/src/source-ipfw.c +++ b/src/source-ipfw.c @@ -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); }