Noalert rules did not apply pass logic to the flow.
Bug #1888.
}
/* set actions on packet */
- DetectSignatureApplyActions(p, p->alerts.alerts[i].s);
+ DetectSignatureApplyActions(p, p->alerts.alerts[i].s, p->alerts.alerts[i].flags);
if (PACKET_TEST_ACTION(p, ACTION_PASS)) {
/* Ok, reset the alert cnt to end in the previous of pass
* so we ignore the rest with less prio */
p->alerts.cnt = i;
-
- /* if an stream/app-layer match we enforce the pass for the flow */
- if ((p->flow != NULL) &&
- (p->alerts.alerts[i].flags &
- (PACKET_ALERT_FLAG_STATE_MATCH|PACKET_ALERT_FLAG_STREAM_MATCH)))
- {
- FlowSetNoPacketInspectionFlag(p->flow);
- }
break;
/* if the signature wants to drop, check if the
PacketAlertAppend(det_ctx, s, p, 0, 0);
} else {
/* apply actions for noalert/rule suppressed as well */
- DetectSignatureApplyActions(p, s);
+ DetectSignatureApplyActions(p, s, 0);
}
}
}
PacketAlertAppend(det_ctx, s, p, tx_id,
PACKET_ALERT_FLAG_STATE_MATCH|PACKET_ALERT_FLAG_TX);
} else {
- DetectSignatureApplyActions(p, s);
+ DetectSignatureApplyActions(p, s,
+ PACKET_ALERT_FLAG_STATE_MATCH|PACKET_ALERT_FLAG_TX);
}
alert_cnt = 1;
SCLogDebug("MATCH: tx %u packet %u", (uint)tx_id, (uint)p->pcap_cnt);
PacketAlertAppend(det_ctx, s, p, 0, alert_flags);
} else {
/* apply actions even if not alerting */
- DetectSignatureApplyActions(p, s);
+ DetectSignatureApplyActions(p, s, alert_flags);
}
next:
DetectVarProcessList(det_ctx, pflow, p);
/** \brief Apply action(s) and Set 'drop' sig info,
* if applicable */
-void DetectSignatureApplyActions(Packet *p, const Signature *s)
+void DetectSignatureApplyActions(Packet *p,
+ const Signature *s, const uint8_t alert_flags)
{
PACKET_UPDATE_ACTION(p, s->action);
p->alerts.drop.action = s->action;
p->alerts.drop.s = (Signature *)s;
}
+ } else if (s->action & ACTION_PASS) {
+ /* if an stream/app-layer match we enforce the pass for the flow */
+ if ((p->flow != NULL) &&
+ (alert_flags & (PACKET_ALERT_FLAG_STATE_MATCH|PACKET_ALERT_FLAG_STREAM_MATCH)))
+ {
+ FlowSetNoPacketInspectionFlag(p->flow);
+ }
+
}
}
int SigMatchSignaturesRunPostMatch(ThreadVars *tv,
DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, Packet *p,
const Signature *s);
-void DetectSignatureApplyActions(Packet *p, const Signature *s);
+void DetectSignatureApplyActions(Packet *p, const Signature *s, const uint8_t);
#endif /* __DETECT_H__ */