Packet inspection keywords modified to not inspect pseudo packet

remotes/origin/master-1.1.x
Anoop Saldanha 14 years ago committed by Victor Julien
parent c365bafbf6
commit 54f8d56f48

@ -230,7 +230,7 @@ int DetectIPV4CsumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx,
{
DetectCsumData *cd = (DetectCsumData *)m->ctx;
if (p->ip4h == NULL)
if (p->ip4h == NULL || PKT_IS_PSEUDOPKT(p))
return 0;
if (p->ip4vars.comp_csum == -1)

@ -114,7 +114,7 @@ static int DetectFlagsMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Pack
uint8_t flags = 0;
DetectFlagsData *de = (DetectFlagsData *)m->ctx;
if(!(PKT_IS_TCP(p))) {
if (!(PKT_IS_TCP(p)) || PKT_IS_PSEUDOPKT(p)) {
SCReturnInt(0);
}

@ -117,7 +117,7 @@ static int DetectFragBitsMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, P
uint16_t fragbits = 0;
DetectFragBitsData *de = (DetectFragBitsData *)m->ctx;
if(!de || !PKT_IS_IPV4(p) || !p)
if (!de || !PKT_IS_IPV4(p) || !p || PKT_IS_PSEUDOPKT(p))
return ret;
if(IPV4_GET_MF(p))

@ -95,6 +95,9 @@ int DetectFragOffsetMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet
uint16_t frag = 0;
DetectFragOffsetData *fragoff = (DetectFragOffsetData *)m->ctx;
if (PKT_IS_PSEUDOPKT(p))
return 0;
if (PKT_IS_IPV4(p)) {
frag = IPV4_GET_IPOFFSET(p);
} else if (PKT_IS_IPV6(p)) {

@ -93,6 +93,9 @@ int DetectIcmpIdMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p,
uint16_t pid;
DetectIcmpIdData *iid = (DetectIcmpIdData *)m->ctx;
if (PKT_IS_PSEUDOPKT(p))
return 0;
if (PKT_IS_ICMPV4(p)) {
SCLogDebug("ICMPV4_GET_ID(p) %"PRIu16" (network byte order), "
"%"PRIu16" (host byte order)", ICMPV4_GET_ID(p),

@ -93,6 +93,9 @@ int DetectIcmpSeqMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p
uint16_t seqn;
DetectIcmpSeqData *iseq = (DetectIcmpSeqData *)m->ctx;
if (PKT_IS_PSEUDOPKT(p))
return 0;
if (PKT_IS_ICMPV4(p)) {
SCLogDebug("ICMPV4_GET_SEQ(p) %"PRIu16" (network byte order), "
"%"PRIu16" (host byte order)", ICMPV4_GET_SEQ(p),

@ -100,6 +100,9 @@ int DetectICodeMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p,
uint8_t picode;
DetectICodeData *icd = (DetectICodeData *)m->ctx;
if (PKT_IS_PSEUDOPKT(p))
return 0;
if (PKT_IS_ICMPV4(p)) {
picode = ICMPV4_GET_CODE(p);
} else if (PKT_IS_ICMPV6(p)) {

@ -100,6 +100,9 @@ int DetectITypeMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p,
uint8_t pitype;
DetectITypeData *itd = (DetectITypeData *)m->ctx;
if (PKT_IS_PSEUDOPKT(p))
return 0;
if (PKT_IS_ICMPV4(p)) {
pitype = ICMPV4_GET_TYPE(p);
} else if (PKT_IS_ICMPV6(p)) {

Loading…
Cancel
Save