From 16b41a5eff130eef2e9e4ff81f640546970974e9 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Thu, 7 Jul 2011 11:24:07 +0200 Subject: [PATCH] Use p->proto in detect to determine TCP/UDP/SCTP. --- src/detect.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/detect.c b/src/detect.c index 61f0315c55..7303ac189a 100644 --- a/src/detect.c +++ b/src/detect.c @@ -1324,16 +1324,16 @@ int SigMatchSignatures(ThreadVars *th_v, DetectEngineCtx *de_ctx, DetectEngineTh /* Retrieve the app layer state and protocol and the tcp reassembled * stream chunks. */ - if ((IP_GET_IPPROTO(p) == IPPROTO_TCP && p->flags & PKT_STREAM_EST) || - (IP_GET_IPPROTO(p) == IPPROTO_UDP && p->flowflags & FLOW_PKT_ESTABLISHED) || - (IP_GET_IPPROTO(p) == IPPROTO_SCTP && p->flowflags & FLOW_PKT_ESTABLISHED)) + if ((p->proto == IPPROTO_TCP && p->flags & PKT_STREAM_EST) || + (p->proto == IPPROTO_UDP && p->flowflags & FLOW_PKT_ESTABLISHED) || + (p->proto == IPPROTO_SCTP && p->flowflags & FLOW_PKT_ESTABLISHED)) { alstate = AppLayerGetProtoStateFromPacket(p); alproto = AppLayerGetProtoFromPacket(p); alversion = AppLayerGetStateVersion(p->flow); SCLogDebug("alstate %p, alproto %u", alstate, alproto); } else { - SCLogDebug("packet doesn't have established flag set (proto %d)", IP_GET_IPPROTO(p)); + SCLogDebug("packet doesn't have established flag set (proto %d)", p->proto); } } SCMutexUnlock(&p->flow->m);