From a55ff64a1b29897ae8c6debb6c786a5625656235 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Tue, 11 Dec 2012 12:10:44 +0100 Subject: [PATCH] Use GET_PKT_LEN and GET_PKT_DATA macro's --- src/detect-csum.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/detect-csum.c b/src/detect-csum.c index d8235158ca..1e06e5801e 100644 --- a/src/detect-csum.c +++ b/src/detect-csum.c @@ -802,7 +802,7 @@ int DetectICMPV6CsumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, DetectCsumData *cd = (DetectCsumData *)m->ctx; if (p->ip6h == NULL || p->icmpv6h == NULL || p->proto != IPPROTO_ICMPV6 || PKT_IS_PSEUDOPKT(p) || - (p->pktlen - ((uint8_t *)p->icmpv6h - p->pkt)) <= 0) { + (GET_PKT_LEN(p) - ((uint8_t *)p->icmpv6h - GET_PKT_DATA(p))) <= 0) { return 0; } @@ -813,7 +813,7 @@ int DetectICMPV6CsumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, if (p->icmpv6vars.comp_csum == -1) p->icmpv6vars.comp_csum = ICMPV6CalculateChecksum(p->ip6h->s_ip6_addrs, (uint16_t *)p->icmpv6h, - p->pktlen - ((uint8_t *)p->icmpv6h - p->pkt)); + GET_PKT_LEN(p) - ((uint8_t *)p->icmpv6h - GET_PKT_DATA(p))); if (p->icmpv6vars.comp_csum == p->icmpv6h->csum && cd->valid == 1) return 1;