From 2b84387ea4571775d1b3dd64b3170610ae13f072 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Tue, 27 Oct 2015 21:49:00 +0100 Subject: [PATCH] detect: work around cocci limitation --- src/detect.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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) -- 2.47.2