More thoroughly cleanup a Packet when we recycle it. Fixes a corner case where we'd have a invalid tcp packet but p->proto would still say IPPROTO_TCP because of a previous run. Fixes bug #187.

remotes/origin/master-1.0.x
Victor Julien 16 years ago
parent 5580f3d9c2
commit 017b95f9ef

@ -471,7 +471,12 @@ typedef struct DecodeThreadVars_
* \todo the mutex destroy & init is necessary because of the memset, reconsider
*/
#define PACKET_RECYCLE(p) do { \
(p)->recursion_level = 0; \
CLEAR_ADDR(&(p)->src); \
CLEAR_ADDR(&(p)->dst); \
(p)->sp = 0; \
(p)->dp = 0; \
(p)->proto = 0; \
(p)->recursion_level = 0; \
(p)->flags = 0; \
(p)->flowflags = 0; \
(p)->flow = NULL; \

@ -71,7 +71,7 @@ static int DetectAckMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx,
DetectAckData *data = (DetectAckData *)m->ctx;
/* This is only needed on TCP packets */
if (IPPROTO_TCP != p->proto) {
if (!(PKT_IS_TCP(p))) {
return 0;
}

@ -72,7 +72,7 @@ static int DetectSeqMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx,
DetectSeqData *data = (DetectSeqData *)m->ctx;
/* This is only needed on TCP packets */
if (IPPROTO_TCP != p->proto) {
if (!(PKT_IS_TCP(p))) {
return 0;
}

Loading…
Cancel
Save