detect: use pflow pointer

Use pflow pointer in SigMatchSignatures consistently. Also, when
needing access to the ipproto, use p->proto, not p->flow->proto.
pull/790/head
Victor Julien 13 years ago
parent 634eb1d35c
commit 54d64a1237

@ -1182,18 +1182,18 @@ int SigMatchSignatures(ThreadVars *th_v, DetectEngineCtx *de_ctx, DetectEngineTh
(p->proto == IPPROTO_UDP) || (p->proto == IPPROTO_UDP) ||
(p->proto == IPPROTO_SCTP && (p->flowflags & FLOW_PKT_ESTABLISHED))) (p->proto == IPPROTO_SCTP && (p->flowflags & FLOW_PKT_ESTABLISHED)))
{ {
alstate = FlowGetAppState(p->flow); alstate = FlowGetAppState(pflow);
alproto = FlowGetAppProtocol(p->flow); alproto = FlowGetAppProtocol(pflow);
alversion = AppLayerParserGetStateVersion(p->flow->alparser); alversion = AppLayerParserGetStateVersion(pflow->alparser);
SCLogDebug("alstate %p, alproto %u", alstate, alproto); SCLogDebug("alstate %p, alproto %u", alstate, alproto);
} else { } else {
SCLogDebug("packet doesn't have established flag set (proto %d)", p->proto); SCLogDebug("packet doesn't have established flag set (proto %d)", p->proto);
} }
app_decoder_events = AppLayerParserHasDecoderEvents(p->flow->proto, app_decoder_events = AppLayerParserHasDecoderEvents(pflow->proto,
p->flow->alproto, pflow->alproto,
p->flow->alstate, pflow->alstate,
p->flow->alparser, pflow->alparser,
flags); flags);
} }
FLOWLOCK_UNLOCK(pflow); FLOWLOCK_UNLOCK(pflow);
@ -1548,7 +1548,7 @@ next:
end: end:
/* see if we need to increment the inspect_id and reset the de_state */ /* see if we need to increment the inspect_id and reset the de_state */
if (alstate != NULL && AppLayerParserProtocolSupportsTxs(p->flow->proto, alproto)) { if (alstate != NULL && AppLayerParserProtocolSupportsTxs(p->proto, alproto)) {
PACKET_PROFILING_DETECT_START(p, PROF_DETECT_STATEFUL); PACKET_PROFILING_DETECT_START(p, PROF_DETECT_STATEFUL);
DeStateUpdateInspectTransactionId(pflow, flags); DeStateUpdateInspectTransactionId(pflow, flags);
PACKET_PROFILING_DETECT_END(p, PROF_DETECT_STATEFUL); PACKET_PROFILING_DETECT_END(p, PROF_DETECT_STATEFUL);

Loading…
Cancel
Save