diff --git a/src/detect-csum.c b/src/detect-csum.c index 76f6902e5a..43c4826e6d 100644 --- a/src/detect-csum.c +++ b/src/detect-csum.c @@ -682,7 +682,7 @@ static int DetectICMPV4CsumMatch(DetectEngineThreadCtx *det_ctx, { const DetectCsumData *cd = (const DetectCsumData *)ctx; - if (!PacketIsIPv4(p) || p->icmpv4h == NULL || p->proto != IPPROTO_ICMP || PKT_IS_PSEUDOPKT(p)) + if (!PacketIsIPv4(p) || !PKT_IS_ICMPV4(p) || p->proto != IPPROTO_ICMP || PKT_IS_PSEUDOPKT(p)) return 0; if (p->flags & PKT_IGNORE_CHECKSUM) { diff --git a/src/detect-icmpv4hdr.c b/src/detect-icmpv4hdr.c index b0c6f54b75..72c9156b2e 100644 --- a/src/detect-icmpv4hdr.c +++ b/src/detect-icmpv4hdr.c @@ -95,7 +95,7 @@ static InspectionBuffer *GetData(DetectEngineThreadCtx *det_ctx, { SCEnter(); - if (p->icmpv4h == NULL) { + if (!PKT_IS_ICMPV4(p)) { SCReturnPtr(NULL, "InspectionBuffer"); } diff --git a/src/flow-util.c b/src/flow-util.c index 97d48a5baa..ce6a54d7be 100644 --- a/src/flow-util.c +++ b/src/flow-util.c @@ -176,7 +176,7 @@ void FlowInit(Flow *f, const Packet *p) } else if (PKT_IS_UDP(p)) { SET_UDP_SRC_PORT(p,&f->sp); SET_UDP_DST_PORT(p,&f->dp); - } else if (p->icmpv4h != NULL) { + } else if (PKT_IS_ICMPV4(p)) { f->icmp_s.type = p->icmp_s.type; f->icmp_s.code = p->icmp_s.code; FlowSetICMPv4CounterPart(f);