SCLogDebug("content %"PRIu32" matched at offset %"PRIu32", but negated so no match", cd->id, match_offset);
/* don't bother carrying recursive matches now, for preceding
* relative keywords */
- det_ctx->discontinue_matching = 1;
+ if (DETECT_CONTENT_IS_SINGLE(cd))
+ det_ctx->discontinue_matching = 1;
SCReturnInt(0);
} else {
match_offset = (uint32_t)((found - buffer) + cd->content_len);
SCMutexUnlock(&f.m);
/* detection phase */
SigMatchSignatures(&tv, de_ctx, det_ctx, p);
- if ((PacketAlertCheck(p, 1))) {
+ if (!(PacketAlertCheck(p, 1))) {
printf("sid 1 matched but shouldn't have for packet: ");
goto end;
}
char sig[] = "alert tcp any any -> any any (msg:\"dummy\"; "
"content:\"fix\"; content:\"this\"; within:6; content:!\"and\"; distance:0; sid:1;)";
- if (UTHPacketMatchSigMpm(p, sig, MPM_B2G) == 1) {
+ if (UTHPacketMatchSigMpm(p, sig, MPM_B2G) != 1) {
goto end;
}
/* do detect */
SigMatchSignatures(&tv, de_ctx, det_ctx, p);
- if (PacketAlertCheck(p, 1)) {
+ if (!PacketAlertCheck(p, 1)) {
printf("sig 1 alerted, but it should not: ");
goto end;
}