From: Victor Julien Date: Tue, 27 Oct 2015 20:49:00 +0000 (+0100) Subject: detect: work around cocci limitation X-Git-Tag: suricata-3.1RC1~315 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b84387ea4571775d1b3dd64b3170610ae13f072;p=thirdparty%2Fsuricata.git detect: work around cocci limitation --- diff --git a/src/detect.c b/src/detect.c index 2db63f08b4..add8f53b1b 100644 --- a/src/detect.c +++ b/src/detect.c @@ -3388,8 +3388,13 @@ static DetectPort *RulesGroupByPorts(DetectEngineCtx *de_ctx, int ipproto, uint3 goto next; if (!(s->proto.proto[ipproto / 8] & (1<<(ipproto % 8)) || (s->proto.flags & DETECT_PROTO_ANY))) goto next; - if (!(s->flags & direction)) - goto next; + if (direction == SIG_FLAG_TOSERVER) { + if (!(s->flags & SIG_FLAG_TOSERVER)) + goto next; + } else if (direction == SIG_FLAG_TOCLIENT) { + if (!(s->flags & SIG_FLAG_TOCLIENT)) + goto next; + } DetectPort *p = NULL; if (direction == SIG_FLAG_TOSERVER)