]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Use GET_PKT_LEN and GET_PKT_DATA macro's
authorVictor Julien <victor@inliniac.net>
Tue, 11 Dec 2012 11:10:44 +0000 (12:10 +0100)
committerVictor Julien <victor@inliniac.net>
Tue, 11 Dec 2012 11:10:44 +0000 (12:10 +0100)
src/detect-csum.c

index d8235158caeb9373ee20b3a460880c6e7cfad6c1..1e06e5801edc2632c5477e547e88e8a92b8cad35 100644 (file)
@@ -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;