]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Remove pkt variable from Packet structure.
authorKen Steele <ken@tilera.com>
Mon, 11 Nov 2013 16:58:31 +0000 (11:58 -0500)
committerKen Steele <ken@tilera.com>
Wed, 11 Dec 2013 17:17:55 +0000 (12:17 -0500)
The uint8_t *pkt in the Packet structure always points to the memory
immediately following the Packet structure. It is better to simply
calculate that value every time than store the 8 byte pointer.

22 files changed:
src/alert-unified2-alert.c
src/app-layer.c
src/decode-ethernet.c
src/decode-icmpv4.c
src/decode-icmpv6.c
src/decode.c
src/decode.h
src/detect-content.c
src/detect-csum.c
src/detect-dsize.c
src/detect-engine-event.c
src/detect-flags.c
src/detect-flowbits.c
src/detect-fragbits.c
src/detect-fragoffset.c
src/detect-ftpbounce.c
src/detect-ipopts.c
src/detect-ipproto.c
src/detect-parse.c
src/detect.c
src/stream-tcp-reassemble.c
src/stream-tcp.c

index 6cf3114339378f67dc856c28b7b9e223999103d3..6ea0e709e7a661fbcf2cdd0623161aa7d31ae722 100644 (file)
@@ -1539,7 +1539,6 @@ static int Unified2Test01 (void)   {
     memset(&dtv, 0, sizeof(DecodeThreadVars));
     memset(&tv, 0, sizeof(ThreadVars));
     memset(&pq, 0, sizeof(PacketQueue));
-    p->pkt = (uint8_t *)(p + 1);
     memset(&s, 0, sizeof(Signature));
 
     p->alerts.cnt++;
@@ -1630,7 +1629,6 @@ static int Unified2Test02 (void)   {
     memset(&dtv, 0, sizeof(DecodeThreadVars));
     memset(&tv, 0, sizeof(ThreadVars));
     memset(&pq, 0, sizeof(PacketQueue));
-    p->pkt = (uint8_t *)(p + 1);
     memset(&s, 0, sizeof(Signature));
 
     p->alerts.cnt++;
@@ -1727,7 +1725,6 @@ static int Unified2Test03 (void) {
     memset(&dtv, 0, sizeof(DecodeThreadVars));
     memset(&tv, 0, sizeof(ThreadVars));
     memset(&pq, 0, sizeof(PacketQueue));
-    p->pkt = (uint8_t *)(p + 1);
     memset(&s, 0, sizeof(Signature));
 
     p->alerts.cnt++;
@@ -1824,7 +1821,6 @@ static int Unified2Test04 (void)   {
     memset(&dtv, 0, sizeof(DecodeThreadVars));
     memset(&tv, 0, sizeof(ThreadVars));
     memset(&pq, 0, sizeof(PacketQueue));
-    p->pkt = (uint8_t *)(p + 1);
     memset(&s, 0, sizeof(Signature));
 
     p->alerts.cnt++;
@@ -1912,7 +1908,6 @@ static int Unified2Test05 (void)   {
     memset(&dtv, 0, sizeof(DecodeThreadVars));
     memset(&tv, 0, sizeof(ThreadVars));
     memset(&pq, 0, sizeof(PacketQueue));
-    p->pkt = (uint8_t *)(p + 1);
     memset(&s, 0, sizeof(Signature));
 
     p->alerts.cnt++;
index 7f380c809ffd31f2125f09e1d80e0e128e862906..820e8296e5c79334699662cddb007676812dcc24 100644 (file)
@@ -647,7 +647,6 @@ static int AppLayerTest01(void)
     memset(&tcph, 0, sizeof (TCPHdr));
 
     f.flags = FLOW_IPV4;
-    p->pkt = (uint8_t *)(p + 1);
     p->flow = &f;
     p->tcph = &tcph;
 
@@ -885,7 +884,6 @@ static int AppLayerTest02(void)
     memset(&tcph, 0, sizeof (TCPHdr));
 
     f.flags = FLOW_IPV4;
-    p->pkt = (uint8_t *)(p + 1);
     p->flow = &f;
     p->tcph = &tcph;
 
@@ -1172,7 +1170,6 @@ end:
     memset(&tcph, 0, sizeof (TCPHdr));
 
     f.flags = FLOW_IPV4;
-    p->pkt = (uint8_t *)(p + 1);
     p->flow = &f;
     p->tcph = &tcph;
 
@@ -1409,7 +1406,6 @@ static int AppLayerTest04(void)
     memset(&tcph, 0, sizeof (TCPHdr));
 
     f.flags = FLOW_IPV4;
-    p->pkt = (uint8_t *)(p + 1);
     p->flow = &f;
     p->tcph = &tcph;
 
@@ -1695,7 +1691,6 @@ static int AppLayerTest05(void)
     memset(&tcph, 0, sizeof (TCPHdr));
 
     f.flags = FLOW_IPV4;
-    p->pkt = (uint8_t *)(p + 1);
     p->flow = &f;
     p->tcph = &tcph;
 
@@ -1933,7 +1928,6 @@ static int AppLayerTest06(void)
     memset(&tcph, 0, sizeof (TCPHdr));
 
     f.flags = FLOW_IPV4;
-    p->pkt = (uint8_t *)(p + 1);
     p->flow = &f;
     p->tcph = &tcph;
 
@@ -2147,7 +2141,6 @@ static int AppLayerTest07(void)
     memset(&tcph, 0, sizeof (TCPHdr));
 
     f.flags = FLOW_IPV4;
-    p->pkt = (uint8_t *)(p + 1);
     p->flow = &f;
     p->tcph = &tcph;
 
@@ -2385,7 +2378,6 @@ static int AppLayerTest08(void)
     memset(&tcph, 0, sizeof (TCPHdr));
 
     f.flags = FLOW_IPV4;
-    p->pkt = (uint8_t *)(p + 1);
     p->flow = &f;
     p->tcph = &tcph;
 
@@ -2625,7 +2617,6 @@ static int AppLayerTest09(void)
     memset(&tcph, 0, sizeof (TCPHdr));
 
     f.flags = FLOW_IPV4;
-    p->pkt = (uint8_t *)(p + 1);
     p->flow = &f;
     p->tcph = &tcph;
 
@@ -2904,7 +2895,6 @@ static int AppLayerTest10(void)
     memset(&tcph, 0, sizeof (TCPHdr));
 
     f.flags = FLOW_IPV4;
-    p->pkt = (uint8_t *)(p + 1);
     p->flow = &f;
     p->tcph = &tcph;
 
@@ -3159,7 +3149,6 @@ static int AppLayerTest11(void)
     memset(&tcph, 0, sizeof (TCPHdr));
 
     f.flags = FLOW_IPV4;
-    p->pkt = (uint8_t *)(p + 1);
     p->flow = &f;
     p->tcph = &tcph;
 
index 88c309a2dab5f5b5031e8887b26f22101b44ef5f..ae7b3dc9f5c958d525ab64e2e879cad2e826d6a9 100644 (file)
@@ -114,14 +114,13 @@ static int DecodeEthernetTest01 (void)   {
 
     Packet *p = SCMalloc(SIZE_OF_PACKET);
     if (unlikely(p == NULL))
-    return 0;
+        return 0;
     ThreadVars tv;
     DecodeThreadVars dtv;
 
     memset(&dtv, 0, sizeof(DecodeThreadVars));
     memset(&tv,  0, sizeof(ThreadVars));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
 
     DecodeEthernet(&tv, &dtv, p, raw_eth, sizeof(raw_eth), NULL);
 
index e810d50b1a7a3542a6c033144eaeff39f27691b4..8b4402e6ff6957f78f1ed77f711057164011f27c 100644 (file)
@@ -330,7 +330,6 @@ static int DecodeICMPV4test01(void) {
     memset(&ip4h, 0, sizeof(IPV4Hdr));
     memset(&tv, 0, sizeof(ThreadVars));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&ip4h, 0, sizeof(IPV4Hdr));
     memset(&dtv, 0, sizeof(DecodeThreadVars));
 
@@ -382,7 +381,6 @@ static int DecodeICMPV4test02(void) {
     memset(&ip4h, 0, sizeof(IPV4Hdr));
     memset(&tv, 0, sizeof(ThreadVars));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&dtv, 0, sizeof(DecodeThreadVars));
 
     FlowInitConfig(FLOW_QUIET);
@@ -431,7 +429,6 @@ static int DecodeICMPV4test03(void) {
     memset(&ip4h, 0, sizeof(IPV4Hdr));
     memset(&tv, 0, sizeof(ThreadVars));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&dtv, 0, sizeof(DecodeThreadVars));
 
     FlowInitConfig(FLOW_QUIET);
@@ -511,7 +508,6 @@ static int DecodeICMPV4test04(void) {
     memset(&ip4h, 0, sizeof(IPV4Hdr));
     memset(&tv, 0, sizeof(ThreadVars));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&dtv, 0, sizeof(DecodeThreadVars));
 
     FlowInitConfig(FLOW_QUIET);
@@ -581,7 +577,6 @@ static int DecodeICMPV4test05(void) {
     memset(&ip4h, 0, sizeof(IPV4Hdr));
     memset(&tv, 0, sizeof(ThreadVars));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&dtv, 0, sizeof(DecodeThreadVars));
 
     FlowInitConfig(FLOW_QUIET);
@@ -686,7 +681,6 @@ static int ICMPV4InvalidType07(void) {
     memset(&ip4h, 0, sizeof(IPV4Hdr));
     memset(&tv, 0, sizeof(ThreadVars));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&dtv, 0, sizeof(DecodeThreadVars));
 
     FlowInitConfig(FLOW_QUIET);
@@ -730,7 +724,6 @@ static int DecodeICMPV4test08(void) {
     memset(&ip4h, 0, sizeof(IPV4Hdr));
     memset(&tv, 0, sizeof(ThreadVars));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&dtv, 0, sizeof(DecodeThreadVars));
 
     FlowInitConfig(FLOW_QUIET);
index de8b1eb96592cab351a2725ab13d8758cb6c4684..bbd540c478b3f23c89649d02a4216f4364fbe538 100644 (file)
@@ -385,7 +385,6 @@ static int ICMPV6ParamProbTest01(void)
 
     memset(&tv, 0, sizeof(ThreadVars));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&dtv, 0, sizeof(DecodeThreadVars));
     memset(&ip6h, 0, sizeof(IPV6Hdr));
 
@@ -458,7 +457,6 @@ static int ICMPV6PktTooBigTest01(void)
 
     memset(&tv, 0, sizeof(ThreadVars));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&dtv, 0, sizeof(DecodeThreadVars));
     memset(&ip6h, 0, sizeof(IPV6Hdr));
 
@@ -534,7 +532,6 @@ static int ICMPV6TimeExceedTest01(void)
 
     memset(&tv, 0, sizeof(ThreadVars));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&dtv, 0, sizeof(DecodeThreadVars));
     memset(&ip6h, 0, sizeof(IPV6Hdr));
 
@@ -611,7 +608,6 @@ static int ICMPV6DestUnreachTest01(void)
 
     memset(&tv, 0, sizeof(ThreadVars));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&dtv, 0, sizeof(DecodeThreadVars));
     memset(&ip6h, 0, sizeof(IPV6Hdr));
 
@@ -675,7 +671,6 @@ static int ICMPV6EchoReqTest01(void)
 
     memset(&tv, 0, sizeof(ThreadVars));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&dtv, 0, sizeof(DecodeThreadVars));
     memset(&ip6h, 0, sizeof(IPV6Hdr));
 
@@ -729,7 +724,6 @@ static int ICMPV6EchoRepTest01(void)
 
     memset(&tv, 0, sizeof(ThreadVars));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&dtv, 0, sizeof(DecodeThreadVars));
     memset(&ip6h, 0, sizeof(IPV6Hdr));
 
@@ -790,7 +784,6 @@ static int ICMPV6ParamProbTest02(void)
 
     memset(&tv, 0, sizeof(ThreadVars));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&dtv, 0, sizeof(DecodeThreadVars));
     memset(&ip6h, 0, sizeof(IPV6Hdr));
 
@@ -852,7 +845,6 @@ static int ICMPV6PktTooBigTest02(void)
 
     memset(&tv, 0, sizeof(ThreadVars));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&dtv, 0, sizeof(DecodeThreadVars));
     memset(&ip6h, 0, sizeof(IPV6Hdr));
 
@@ -905,7 +897,6 @@ static int ICMPV6TimeExceedTest02(void)
 
     memset(&tv, 0, sizeof(ThreadVars));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&dtv, 0, sizeof(DecodeThreadVars));
     memset(&ip6h, 0, sizeof(IPV6Hdr));
 
@@ -955,7 +946,6 @@ static int ICMPV6DestUnreachTest02(void)
 
     memset(&tv, 0, sizeof(ThreadVars));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&dtv, 0, sizeof(DecodeThreadVars));
     memset(&ip6h, 0, sizeof(IPV6Hdr));
 
@@ -1001,7 +991,6 @@ static int ICMPV6EchoReqTest02(void)
 
     memset(&tv, 0, sizeof(ThreadVars));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&dtv, 0, sizeof(DecodeThreadVars));
     memset(&ip6h, 0, sizeof(IPV6Hdr));
 
@@ -1047,7 +1036,6 @@ static int ICMPV6EchoRepTest02(void)
 
     memset(&tv, 0, sizeof(ThreadVars));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&dtv, 0, sizeof(DecodeThreadVars));
     memset(&ip6h, 0, sizeof(IPV6Hdr));
 
@@ -1096,7 +1084,6 @@ static int ICMPV6PayloadTest01(void)
 
     memset(&tv, 0, sizeof(ThreadVars));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&dtv, 0, sizeof(DecodeThreadVars));
     memset(&ip6h, 0, sizeof(IPV6Hdr));
 
index 409203775c10f8f93ba9a7faac1243a096e98da8..d75aa256f2b1f810b5c3d700994f58099ada0edb 100644 (file)
@@ -195,7 +195,7 @@ inline int PacketCopyDataOffset(Packet *p, int offset, uint8_t *data, int datale
     if (! p->ext_pkt) {
         if (offset + datalen <= (int)default_packet_size) {
             /* data will fit in memory allocated with packet */
-            memcpy(p->pkt + offset, data, datalen);
+            memcpy(GET_PKT_DIRECT_DATA(p) + offset, data, datalen);
         } else {
             /* here we need a dynamic allocation */
             p->ext_pkt = SCMalloc(MAX_PAYLOAD_SIZE);
index d2e85cd7a079971ba64ee499d44a5d65308d8b20..5c339dd39f08bd30209103fffcbd97e85fa7c353 100644 (file)
@@ -198,8 +198,8 @@ typedef struct Address_ {
 #define GET_TCP_DST_PORT(p)  ((p)->dp)
 
 #define GET_PKT_LEN(p) ((p)->pktlen)
-#define GET_PKT_DATA(p) ((((p)->ext_pkt) == NULL ) ? (p)->pkt : (p)->ext_pkt)
-#define GET_PKT_DIRECT_DATA(p) ((p)->pkt)
+#define GET_PKT_DATA(p) ((((p)->ext_pkt) == NULL ) ? (uint8_t *)((p) + 1) : (p)->ext_pkt)
+#define GET_PKT_DIRECT_DATA(p) (uint8_t *)((p) + 1)
 #define GET_PKT_DIRECT_MAX_SIZE(p) (default_packet_size)
 
 #define SET_PKT_LEN(p, len) do { \
@@ -470,7 +470,6 @@ typedef struct Packet_
 
     /* storage: set to pointer to heap and extended via allocation if necessary */
     uint32_t pktlen;
-    uint8_t *pkt;
     uint8_t *ext_pkt;
 
     /* Incoming interface */
@@ -638,7 +637,6 @@ typedef struct DecodeThreadVars_
         memset((p), 0x00, SIZE_OF_PACKET);                              \
         SCMutexInit(&(p)->tunnel_mutex, NULL);                          \
         PACKET_RESET_CHECKSUMS((p));                                    \
-        (p)->pkt = ((uint8_t *)(p)) + sizeof(Packet);                   \
         (p)->livedev = NULL;                                            \
         SCMutexInit(&(p)->cuda_pkt_vars.cuda_mutex, NULL);            \
         SCCondInit(&(p)->cuda_pkt_vars.cuda_cond, NULL);                \
@@ -647,7 +645,6 @@ typedef struct DecodeThreadVars_
 #define PACKET_INITIALIZE(p) {         \
     SCMutexInit(&(p)->tunnel_mutex, NULL); \
     PACKET_RESET_CHECKSUMS((p)); \
-    (p)->pkt = ((uint8_t *)(p)) + sizeof(Packet); \
     (p)->livedev = NULL; \
 }
 #endif
index 25817eda25360bb0ffcd2429603b990a03678c01..d42f22ccadf9b7fa64ce730652e8826f0fa0867d 100644 (file)
@@ -636,7 +636,6 @@ int DetectContentLongPatternMatchTest(uint8_t *raw_eth_pkt, uint16_t pktsize, ch
     DetectEngineThreadCtx *det_ctx = NULL;
 
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&dtv, 0, sizeof(DecodeThreadVars));
     memset(&th_v, 0, sizeof(th_v));
 
index 0e3c857084d571f7672fb7231a6ffb436ae03bbf..5e0d5476c8813139c7a6cc43c098b95d63f36cbb 100644 (file)
@@ -1518,7 +1518,6 @@ int DetectCsumICMPV6Test01(void)
 
     PacketCopyData(p, pkt, sizeof(pkt));
 
-
     memset(&tv, 0, sizeof(tv));
     memset(&dtv, 0, sizeof(dtv));
 
index 5aab720ceb2d6511813a6d82b2c2caebd32dbe35..fc007ac47da4fed57811fc7310a1038f1a66f893 100644 (file)
@@ -722,7 +722,6 @@ int DetectDsizeIcmpv6Test01 (void) {
 
     memset(&tv, 0, sizeof(ThreadVars));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&dtv, 0, sizeof(DecodeThreadVars));
     memset(&ip6h, 0, sizeof(IPV6Hdr));
     memset(&th_v, 0, sizeof(ThreadVars));
index daf77124a6516f80a2f9887291d2343449438575..0887dc2a3381dc9a6ebd94cd8ac06ecf0bb39e40 100644 (file)
@@ -355,7 +355,6 @@ int EngineEventTestParse06 (void) {
 
     memset(&tv, 0, sizeof(ThreadVars));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
 
     ENGINE_SET_EVENT(p,PPP_PKT_TOO_SMALL);
 
index f47f5cd955c5ae8668255bc0f24ca58c5865d8b5..557de7d1ab82f0962ae6238c587a93de583238e4 100644 (file)
@@ -578,7 +578,6 @@ static int FlagsTestParse03 (void) {
 
     memset(&tv, 0, sizeof(ThreadVars));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&ipv4h, 0, sizeof(IPV4Hdr));
     memset(&tcph, 0, sizeof(TCPHdr));
 
@@ -633,7 +632,6 @@ static int FlagsTestParse04 (void) {
 
     memset(&tv, 0, sizeof(ThreadVars));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&ipv4h, 0, sizeof(IPV4Hdr));
     memset(&tcph, 0, sizeof(TCPHdr));
 
@@ -688,7 +686,6 @@ static int FlagsTestParse05 (void) {
 
     memset(&tv, 0, sizeof(ThreadVars));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&ipv4h, 0, sizeof(IPV4Hdr));
     memset(&tcph, 0, sizeof(TCPHdr));
 
@@ -743,7 +740,6 @@ static int FlagsTestParse06 (void) {
 
     memset(&tv, 0, sizeof(ThreadVars));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&ipv4h, 0, sizeof(IPV4Hdr));
     memset(&tcph, 0, sizeof(TCPHdr));
 
@@ -798,7 +794,6 @@ static int FlagsTestParse07 (void) {
 
     memset(&tv, 0, sizeof(ThreadVars));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&ipv4h, 0, sizeof(IPV4Hdr));
     memset(&tcph, 0, sizeof(TCPHdr));
 
@@ -853,7 +848,6 @@ static int FlagsTestParse08 (void) {
 
     memset(&tv, 0, sizeof(ThreadVars));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&ipv4h, 0, sizeof(IPV4Hdr));
     memset(&tcph, 0, sizeof(TCPHdr));
 
@@ -908,7 +902,6 @@ static int FlagsTestParse09 (void) {
 
     memset(&tv, 0, sizeof(ThreadVars));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&ipv4h, 0, sizeof(IPV4Hdr));
     memset(&tcph, 0, sizeof(TCPHdr));
 
@@ -963,7 +956,6 @@ static int FlagsTestParse10 (void) {
 
     memset(&tv, 0, sizeof(ThreadVars));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&ipv4h, 0, sizeof(IPV4Hdr));
     memset(&tcph, 0, sizeof(TCPHdr));
 
@@ -1018,7 +1010,6 @@ static int FlagsTestParse11 (void) {
 
     memset(&tv, 0, sizeof(ThreadVars));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&ipv4h, 0, sizeof(IPV4Hdr));
     memset(&tcph, 0, sizeof(TCPHdr));
 
@@ -1073,7 +1064,6 @@ static int FlagsTestParse12 (void) {
 
     memset(&tv, 0, sizeof(ThreadVars));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&ipv4h, 0, sizeof(IPV4Hdr));
     memset(&tcph, 0, sizeof(TCPHdr));
 
@@ -1159,7 +1149,6 @@ static int FlagsTestParse15(void)
 
     memset(&tv, 0, sizeof(ThreadVars));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&ipv4h, 0, sizeof(IPV4Hdr));
     memset(&tcph, 0, sizeof(TCPHdr));
 
@@ -1213,7 +1202,6 @@ static int FlagsTestParse16(void)
 
     memset(&tv, 0, sizeof(ThreadVars));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&ipv4h, 0, sizeof(IPV4Hdr));
     memset(&tcph, 0, sizeof(TCPHdr));
 
@@ -1270,7 +1258,6 @@ static int FlagsTestParse17(void)
 
     memset(&tv, 0, sizeof(ThreadVars));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&ipv4h, 0, sizeof(IPV4Hdr));
     memset(&tcph, 0, sizeof(TCPHdr));
 
index 30cae06c673a0bd6293bf7a6da0e980109d41429..62f8a06a4a31110cc3c09de0547c318c275562bd 100644 (file)
@@ -306,7 +306,6 @@ static int FlowBitsTestSig01(void) {
 
     memset(&th_v, 0, sizeof(th_v));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     p->src.family = AF_INET;
     p->dst.family = AF_INET;
     p->payload = buf;
@@ -382,7 +381,6 @@ static int FlowBitsTestSig02(void) {
 
     memset(&th_v, 0, sizeof(th_v));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     p->src.family = AF_INET;
     p->dst.family = AF_INET;
     p->payload = buf;
@@ -503,7 +501,6 @@ static int FlowBitsTestSig03(void) {
 
     memset(&th_v, 0, sizeof(th_v));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     p->src.family = AF_INET;
     p->dst.family = AF_INET;
     p->payload = buf;
@@ -582,7 +579,6 @@ static int FlowBitsTestSig04(void) {
 
     memset(&th_v, 0, sizeof(th_v));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     p->src.family = AF_INET;
     p->dst.family = AF_INET;
     p->payload = buf;
@@ -663,7 +659,6 @@ static int FlowBitsTestSig05(void) {
 
     memset(&th_v, 0, sizeof(th_v));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     p->src.family = AF_INET;
     p->dst.family = AF_INET;
     p->payload = buf;
@@ -744,7 +739,6 @@ static int FlowBitsTestSig06(void) {
     int idx = 0;
 
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&th_v, 0, sizeof(th_v));
     memset(&f, 0, sizeof(Flow));
     memset(&flowvar, 0, sizeof(GenericVar));
@@ -848,7 +842,6 @@ static int FlowBitsTestSig07(void) {
     int idx = 0;
 
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&th_v, 0, sizeof(th_v));
     memset(&f, 0, sizeof(Flow));
     memset(&flowvar, 0, sizeof(GenericVar));
@@ -955,7 +948,6 @@ static int FlowBitsTestSig08(void) {
     int idx = 0;
 
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&th_v, 0, sizeof(th_v));
     memset(&f, 0, sizeof(Flow));
     memset(&flowvar, 0, sizeof(GenericVar));
index 262621e280c67d491f95ccbcd64367c9df222120..9e0b96b83b78f445ff894777200bb811b2dd4712 100644 (file)
@@ -420,7 +420,6 @@ static int FragBitsTestParse03 (void) {
 
     memset(&tv, 0, sizeof(ThreadVars));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&dtv, 0, sizeof(DecodeThreadVars));
     memset(&ipv4h, 0, sizeof(IPV4Hdr));
     AlpProtoFinalize2Thread(&dtv.udp_dp_ctx);
@@ -517,7 +516,6 @@ static int FragBitsTestParse04 (void) {
 
     memset(&tv, 0, sizeof(ThreadVars));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&dtv, 0, sizeof(DecodeThreadVars));
     memset(&ipv4h, 0, sizeof(IPV4Hdr));
     AlpProtoFinalize2Thread(&dtv.udp_dp_ctx);
index 4fae50a34f65ef0bb11e08c8d710faadb120eefc..2cbf0bdf4c536d32a773bdef6e87fefb98ea598e 100644 (file)
@@ -313,7 +313,6 @@ int DetectFragOffsetMatchTest01 (void) {
     IPV4Hdr ip4h;
 
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&ip4h, 0, sizeof(IPV4Hdr));
     memset(&dtv, 0, sizeof(DecodeThreadVars));
     memset(&th_v, 0, sizeof(ThreadVars));
index ee1837aacaeacd93106857663d45e755ae119e27..7de268752f1cab65d6f82c5bf5ab940af500aca3 100644 (file)
@@ -425,7 +425,6 @@ static int DetectFtpbounceTestALMatch03(void) {
 
     memset(&th_v, 0, sizeof(th_v));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&f, 0, sizeof(f));
     memset(&ssn, 0, sizeof(ssn));
 
index 4e0f351beaa2f7a96e2ea8d0421b5eebc2b171f2..3791966cb0f45b8f07ceaff3a3a6377e9a4f7055 100644 (file)
@@ -281,7 +281,6 @@ int IpOptsTestParse03 (void) {
 
     memset(&tv, 0, sizeof(ThreadVars));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&ip4h, 0, sizeof(IPV4Hdr));
 
     p->ip4h = &ip4h;
@@ -333,7 +332,6 @@ int IpOptsTestParse04 (void) {
 
     memset(&tv, 0, sizeof(ThreadVars));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&ip4h, 0, sizeof(IPV4Hdr));
 
     p->ip4h = &ip4h;
index a71444785ff001ce1726083e1d50706c8419d60b..934cbed2f9962b5d7926524a7a214de37b8e15b3 100644 (file)
@@ -9293,7 +9293,6 @@ static int DetectIPProtoTestSig2(void)
     if (unlikely(p == NULL))
         return 0;
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
 
     DecodeThreadVars dtv;
     ThreadVars th_v;
@@ -9377,16 +9376,13 @@ static int DetectIPProtoTestSig3(void)
     };
 
     Packet *p = UTHBuildPacket((uint8_t *)"boom", 4, IPPROTO_TCP);
-    //Packet *p = SCMalloc(SIZE_OF_PACKET);
     if (p == NULL)
         return 0;
-    //memset(p, 0, SIZE_OF_PACKET);
 
     DecodeThreadVars dtv;
     ThreadVars th_v;
     DetectEngineThreadCtx *det_ctx = NULL;
 
-    p->pkt = ((uint8_t *)p) + sizeof(*p);
     p->proto = 0;
     memset(&dtv, 0, sizeof(DecodeThreadVars));
     memset(&th_v, 0, sizeof(th_v));
index 25a0d0455e3992b472d8d3f3f08b607723257403..626af959e6492a8838794581ae509b25f41ecd69 100644 (file)
@@ -2989,7 +2989,6 @@ int SigTestBidirec04 (void) {
 
     memset(&th_v, 0, sizeof(th_v));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
 
     FlowInitConfig(FLOW_QUIET);
     DecodeEthernet(&th_v, &dtv, p, rawpkt1_ether, sizeof(rawpkt1_ether), NULL);
index c0dc76b599b454db1383c71e2ade6281e60479e5..f1ce18c97328295211da83434f3a6ea36a07501c 100644 (file)
@@ -5845,7 +5845,6 @@ static int SigTest15Real (int mpm_type) {
 
     memset(&th_v, 0, sizeof(th_v));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     p->src.family = AF_INET;
     p->dst.family = AF_INET;
     p->payload = buf;
@@ -6053,7 +6052,6 @@ static int SigTest18Real (int mpm_type) {
 
     memset(&th_v, 0, sizeof(th_v));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     p->src.family = AF_INET;
     p->dst.family = AF_INET;
     p->payload = buf;
@@ -6117,7 +6115,6 @@ int SigTest19Real (int mpm_type) {
 
     memset(&th_v, 0, sizeof(th_v));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     p->src.family = AF_INET;
     p->src.addr_data32[0] = UTHSetIPv4Address("192.168.0.1");
     p->dst.addr_data32[0] = UTHSetIPv4Address("1.2.3.4");
@@ -6188,7 +6185,6 @@ static int SigTest20Real (int mpm_type) {
 
     memset(&th_v, 0, sizeof(th_v));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     p->src.family = AF_INET;
     p->src.addr_data32[0] = UTHSetIPv4Address("192.168.0.1");
     p->dst.addr_data32[0] = UTHSetIPv4Address("1.2.3.4");
@@ -6539,11 +6535,9 @@ int SigTest24IPV4Keyword(void)
 
     memset(&th_v, 0, sizeof(ThreadVars));
     memset(p1, 0, SIZE_OF_PACKET);
-    p1->pkt = (uint8_t *)(p1 + 1);
     memset(p2, 0, SIZE_OF_PACKET);
-    p2->pkt = (uint8_t *)(p2 + 1);
-    PACKET_RESET_CHECKSUMS(p1);
-    PACKET_RESET_CHECKSUMS(p2);
+    p1->ip4vars.comp_csum = -1;
+    p2->ip4vars.comp_csum = -1;
 
     p1->ip4h = (IPV4Hdr *)valid_raw_ipv4;
 
@@ -6645,11 +6639,9 @@ int SigTest25NegativeIPV4Keyword(void)
 
     memset(&th_v, 0, sizeof(ThreadVars));
     memset(p1, 0, SIZE_OF_PACKET);
-    p1->pkt = (uint8_t *)(p1 + 1);
     memset(p2, 0, SIZE_OF_PACKET);
-    p2->pkt = (uint8_t *)(p2 + 1);
-    PACKET_RESET_CHECKSUMS(p1);
-    PACKET_RESET_CHECKSUMS(p2);
+    p1->ip4vars.comp_csum = -1;
+    p2->ip4vars.comp_csum = -1;
 
     p1->ip4h = (IPV4Hdr *)valid_raw_ipv4;
 
@@ -6755,9 +6747,7 @@ int SigTest26TCPV4Keyword(void)
 
     memset(&th_v, 0, sizeof(ThreadVars));
     memset(p1, 0, SIZE_OF_PACKET);
-    p1->pkt = (uint8_t *)(p1 + 1);
     memset(p2, 0, SIZE_OF_PACKET);
-    p2->pkt = (uint8_t *)(p2 + 1);
 
     PacketCopyData(p1, raw_ipv4, sizeof(raw_ipv4));
     PacketCopyDataOffset(p1, GET_PKT_LEN(p1), valid_raw_tcp, sizeof(valid_raw_tcp));
@@ -7115,9 +7105,7 @@ static int SigTest27NegativeTCPV4Keyword(void)
 
     memset(&th_v, 0, sizeof(ThreadVars));
     memset(p1, 0, SIZE_OF_PACKET);
-    p1->pkt = (uint8_t *)(p1 + 1);
     memset(p2, 0, SIZE_OF_PACKET);
-    p2->pkt = (uint8_t *)(p2 + 1);
 
     PacketCopyData(p1, raw_ipv4, sizeof(raw_ipv4));
     PacketCopyDataOffset(p1, GET_PKT_LEN(p1), valid_raw_tcp, sizeof(valid_raw_tcp));
@@ -7243,9 +7231,7 @@ int SigTest28TCPV6Keyword(void)
 
     memset(&th_v, 0, sizeof(ThreadVars));
     memset(p1, 0, SIZE_OF_PACKET);
-    p1->pkt = (uint8_t *)(p1 + 1);
     memset(p2, 0, SIZE_OF_PACKET);
-    p2->pkt = (uint8_t *)(p2 + 1);
 
     PACKET_RESET_CHECKSUMS(p1);
     p1->ip6h = (IPV6Hdr *)(valid_raw_ipv6 + 14);
@@ -7373,9 +7359,7 @@ int SigTest29NegativeTCPV6Keyword(void)
 
     memset(&th_v, 0, sizeof(ThreadVars));
     memset(p1, 0, SIZE_OF_PACKET);
-    p1->pkt = (uint8_t *)(p1 + 1);
     memset(p2, 0, SIZE_OF_PACKET);
-    p2->pkt = (uint8_t *)(p2 + 1);
 
     PACKET_RESET_CHECKSUMS(p1);
     p1->ip6h = (IPV6Hdr *)(valid_raw_ipv6 + 14);
@@ -7501,9 +7485,7 @@ int SigTest30UDPV4Keyword(void)
 
     memset(&th_v, 0, sizeof(ThreadVars));
     memset(p1, 0, SIZE_OF_PACKET);
-    p1->pkt = (uint8_t *)(p1 + 1);
     memset(p2, 0, SIZE_OF_PACKET);
-    p2->pkt = (uint8_t *)(p2 + 1);
 
     PACKET_RESET_CHECKSUMS(p1);
     p1->ip4h = (IPV4Hdr *)raw_ipv4;
@@ -7626,9 +7608,7 @@ int SigTest31NegativeUDPV4Keyword(void)
 
     memset(&th_v, 0, sizeof(ThreadVars));
     memset(p1, 0, SIZE_OF_PACKET);
-    p1->pkt = (uint8_t *)(p1 + 1);
     memset(p2, 0, SIZE_OF_PACKET);
-    p2->pkt = (uint8_t *)(p2 + 1);
 
     PACKET_RESET_CHECKSUMS(p1);
     p1->ip4h = (IPV4Hdr *)raw_ipv4;
@@ -7745,9 +7725,7 @@ int SigTest32UDPV6Keyword(void)
 
     memset(&th_v, 0, sizeof(ThreadVars));
     memset(p1, 0, SIZE_OF_PACKET);
-    p1->pkt = (uint8_t *)(p1 + 1);
     memset(p2, 0, SIZE_OF_PACKET);
-    p2->pkt = (uint8_t *)(p2 + 1);
 
     PACKET_RESET_CHECKSUMS(p1);
     p1->ip6h = (IPV6Hdr *)(valid_raw_ipv6 + 14);
@@ -7862,9 +7840,7 @@ int SigTest33NegativeUDPV6Keyword(void)
 
     memset(&th_v, 0, sizeof(ThreadVars));
     memset(p1, 0, SIZE_OF_PACKET);
-    p1->pkt = (uint8_t *)(p1 + 1);
     memset(p2, 0, SIZE_OF_PACKET);
-    p2->pkt = (uint8_t *)(p2 + 1);
 
     PACKET_RESET_CHECKSUMS(p1);
     p1->ip6h = (IPV6Hdr *)(valid_raw_ipv6 + 14);
@@ -7982,9 +7958,7 @@ int SigTest34ICMPV4Keyword(void)
 
     memset(&th_v, 0, sizeof(ThreadVars));
     memset(p1, 0, SIZE_OF_PACKET);
-    p1->pkt = (uint8_t *)(p1 + 1);
     memset(p2, 0, SIZE_OF_PACKET);
-    p2->pkt = (uint8_t *)(p2 + 1);
 
     PACKET_RESET_CHECKSUMS(p1);
     p1->ip4h = (IPV4Hdr *)(valid_raw_ipv4);
@@ -8104,9 +8078,7 @@ int SigTest35NegativeICMPV4Keyword(void)
 
     memset(&th_v, 0, sizeof(ThreadVars));
     memset(p1, 0, SIZE_OF_PACKET);
-    p1->pkt = (uint8_t *)(p1 + 1);
     memset(p2, 0, SIZE_OF_PACKET);
-    p2->pkt = (uint8_t *)(p2 + 1);
 
     PACKET_RESET_CHECKSUMS(p1);
     p1->ip4h = (IPV4Hdr *)(valid_raw_ipv4);
@@ -8237,9 +8209,7 @@ int SigTest36ICMPV6Keyword(void)
 
     memset(&th_v, 0, sizeof(ThreadVars));
     memset(p1, 0, SIZE_OF_PACKET);
-    p1->pkt = (uint8_t *)(p1 + 1);
     memset(p2, 0, SIZE_OF_PACKET);
-    p2->pkt = (uint8_t *)(p2 + 1);
 
     PACKET_RESET_CHECKSUMS(p1);
     p1->ip6h = (IPV6Hdr *)(valid_raw_ipv6 + 14);
@@ -8367,9 +8337,7 @@ int SigTest37NegativeICMPV6Keyword(void)
 
     memset(&th_v, 0, sizeof(ThreadVars));
     memset(p1, 0, SIZE_OF_PACKET);
-    p1->pkt = (uint8_t *)(p1 + 1);
     memset(p2, 0, SIZE_OF_PACKET);
-    p2->pkt = (uint8_t *)(p2 + 1);
 
     PACKET_RESET_CHECKSUMS(p1);
     p1->ip6h = (IPV6Hdr *)(valid_raw_ipv6 + 14);
@@ -8485,7 +8453,6 @@ int SigTest38Real(int mpm_type)
 
     memset(&th_v, 0, sizeof(ThreadVars));
     memset(p1, 0, SIZE_OF_PACKET);
-    p1->pkt = (uint8_t *)(p1 + 1);
 
     /* Copy raw data into packet */
     if (PacketCopyData(p1, raw_eth, ethlen) == -1) {
@@ -8628,7 +8595,6 @@ int SigTest39Real(int mpm_type)
 
     memset(&th_v, 0, sizeof(ThreadVars));
     memset(p1, 0, SIZE_OF_PACKET);
-    p1->pkt = (uint8_t *)(p1 + 1);
 
     /* Copy raw data into packet */
     if (PacketCopyData(p1, raw_eth, ethlen) == -1) {
@@ -8784,7 +8750,6 @@ int SigTest36ContentAndIsdataatKeywords01Real (int mpm_type) {
     DetectEngineThreadCtx *det_ctx = NULL;
 
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&dtv, 0, sizeof(DecodeThreadVars));
     memset(&th_v, 0, sizeof(th_v));
 
@@ -8906,7 +8871,6 @@ int SigTest37ContentAndIsdataatKeywords02Real (int mpm_type) {
     DetectEngineThreadCtx *det_ctx = NULL;
 
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&dtv, 0, sizeof(DecodeThreadVars));
     memset(&th_v, 0, sizeof(th_v));
 
@@ -9034,7 +8998,6 @@ int SigTest40NoPacketInspection01(void) {
 
     memset(&th_v, 0, sizeof(th_v));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&pq, 0, sizeof(pq));
     memset(&f, 0, sizeof(f));
     memset(&tcphdr, 0, sizeof(tcphdr));
@@ -9107,7 +9070,6 @@ int SigTest40NoPayloadInspection02(void) {
 
     memset(&th_v, 0, sizeof(th_v));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     p->src.family = AF_INET;
     p->dst.family = AF_INET;
     p->payload = buf;
@@ -9169,7 +9131,6 @@ static int SigTestMemory01 (void) {
 
     memset(&th_v, 0, sizeof(th_v));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     p->src.family = AF_INET;
     p->dst.family = AF_INET;
     p->payload = buf;
@@ -9637,7 +9598,6 @@ static int SigTestSgh03 (void) {
 
     memset(&th_v, 0, sizeof(th_v));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     p->src.family = AF_INET;
     p->dst.family = AF_INET;
     p->payload_len = 1;
@@ -9809,7 +9769,6 @@ static int SigTestSgh04 (void) {
 
     memset(&th_v, 0, sizeof(th_v));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     p->src.family = AF_INET;
     p->dst.family = AF_INET;
     p->payload_len = 1;
@@ -10002,7 +9961,6 @@ static int SigTestSgh05 (void) {
 
     memset(&th_v, 0, sizeof(th_v));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     p->src.family = AF_INET;
     p->dst.family = AF_INET;
     p->payload_len = 1;
@@ -10549,7 +10507,6 @@ static int SigTestWithinReal01 (int mpm_type) {
     if (unlikely(p1 == NULL))
         return 0;
     memset(p1, 0, SIZE_OF_PACKET);
-    p1->pkt = (uint8_t *)(p1 + 1);
     DecodeEthernet(&th_v, &dtv, p1, rawpkt1, sizeof(rawpkt1), NULL);
     SigMatchSignatures(&th_v, de_ctx, det_ctx, p1);
     if (!(PacketAlertCheck(p1, 556))) {
@@ -10562,7 +10519,6 @@ static int SigTestWithinReal01 (int mpm_type) {
     if (unlikely(p2 == NULL))
         return 0;
     memset(p2, 0, SIZE_OF_PACKET);
-    p2->pkt = (uint8_t *)(p2 + 1);
     DecodeEthernet(&th_v, &dtv, p2, rawpkt2, sizeof(rawpkt2), NULL);
     SigMatchSignatures(&th_v, de_ctx, det_ctx, p2);
     if (!(PacketAlertCheck(p2, 556))) {
@@ -10575,7 +10531,6 @@ static int SigTestWithinReal01 (int mpm_type) {
     if (unlikely(p3 == NULL))
         return 0;
     memset(p3, 0, SIZE_OF_PACKET);
-    p3->pkt = (uint8_t *)(p3 + 1);
     DecodeEthernet(&th_v, &dtv, p3, rawpkt3, sizeof(rawpkt3), NULL);
     SigMatchSignatures(&th_v, de_ctx, det_ctx, p3);
     if (!(PacketAlertCheck(p3, 556))) {
@@ -10588,7 +10543,6 @@ static int SigTestWithinReal01 (int mpm_type) {
     if (unlikely(p4 == NULL))
         return 0;
     memset(p4, 0, SIZE_OF_PACKET);
-    p4->pkt = (uint8_t *)(p4 + 1);
     DecodeEthernet(&th_v, &dtv, p4, rawpkt4, sizeof(rawpkt4), NULL);
     SigMatchSignatures(&th_v, de_ctx, det_ctx, p4);
     if (!(PacketAlertCheck(p4, 556))) {
index d61ad2c14676785f7291568984ae8764d47b8db4..6f160704575f37945fe5a05602184e3c37e147a7 100644 (file)
@@ -6236,7 +6236,6 @@ static int StreamTcpReassembleTest39 (void) {
     memset(&tcph, 0, sizeof (TCPHdr));
 
     f.flags = FLOW_IPV4;
-    p->pkt = (uint8_t *)(p + 1);
     p->flow = &f;
     p->tcph = &tcph;
 
index 6500627872ab0b3bd2847c8ace58dafe05636b6e..a17a4b6c12f9daa0787fc1bfea6bf0eb9787621a 100644 (file)
@@ -5444,7 +5444,6 @@ static int StreamTcpTest01 (void) {
         return 0;
     Flow f;
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset (&f, 0, sizeof(Flow));
     p->flow = &f;
     int ret = 0;
@@ -5500,7 +5499,6 @@ static int StreamTcpTest02 (void) {
     memset(&stream_q, 0, sizeof(StreamMsgQueue));
     memset(&ra_ctx, 0, sizeof(TcpReassemblyThreadCtx));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset (&f, 0, sizeof(Flow));
     memset(&tv, 0, sizeof (ThreadVars));
     memset(&stt, 0, sizeof (StreamTcpThread));
@@ -5595,7 +5593,6 @@ static int StreamTcpTest03 (void) {
     StreamTcpThread stt;
     TCPHdr tcph;
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     PacketQueue pq;
     memset(&pq,0,sizeof(PacketQueue));
     memset (&f, 0, sizeof(Flow));
@@ -5671,7 +5668,6 @@ static int StreamTcpTest04 (void) {
     StreamTcpThread stt;
     TCPHdr tcph;
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     PacketQueue pq;
     memset(&pq,0,sizeof(PacketQueue));
     memset (&f, 0, sizeof(Flow));
@@ -5741,7 +5737,6 @@ static int StreamTcpTest05 (void) {
     TCPHdr tcph;
     uint8_t payload[4];
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     PacketQueue pq;
     memset(&pq,0,sizeof(PacketQueue));
     memset (&f, 0, sizeof(Flow));
@@ -5846,7 +5841,6 @@ static int StreamTcpTest06 (void) {
     StreamTcpThread stt;
     TCPHdr tcph;
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     PacketQueue pq;
     memset(&pq,0,sizeof(PacketQueue));
     memset (&f, 0, sizeof(Flow));
@@ -5916,7 +5910,6 @@ static int StreamTcpTest07 (void) {
     PacketQueue pq;
 
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&pq,0,sizeof(PacketQueue));
     memset (&f, 0, sizeof(Flow));
     memset(&tv, 0, sizeof (ThreadVars));
@@ -6005,7 +5998,6 @@ static int StreamTcpTest08 (void) {
     uint32_t data[2];
 
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     PacketQueue pq;
     memset(&pq,0,sizeof(PacketQueue));
     memset (&f, 0, sizeof(Flow));
@@ -6094,7 +6086,6 @@ static int StreamTcpTest09 (void) {
     uint8_t payload[1] = {0x42};
 
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     PacketQueue pq;
     memset(&pq,0,sizeof(PacketQueue));
     memset (&f, 0, sizeof(Flow));
@@ -6171,7 +6162,6 @@ static int StreamTcpTest10 (void) {
     TCPHdr tcph;
     uint8_t payload[4];
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     PacketQueue pq;
     memset(&pq,0,sizeof(PacketQueue));
     memset (&f, 0, sizeof(Flow));
@@ -6273,7 +6263,6 @@ static int StreamTcpTest11 (void) {
     TCPHdr tcph;
     uint8_t payload[4];
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     PacketQueue pq;
     memset(&pq,0,sizeof(PacketQueue));
     memset (&f, 0, sizeof(Flow));
@@ -6376,7 +6365,6 @@ static int StreamTcpTest12 (void) {
     TCPHdr tcph;
     uint8_t payload[4];
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     PacketQueue pq;
     memset(&pq,0,sizeof(PacketQueue));
     memset (&f, 0, sizeof(Flow));
@@ -6472,7 +6460,6 @@ static int StreamTcpTest13 (void) {
     TCPHdr tcph;
     uint8_t payload[4];
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     PacketQueue pq;
     memset(&pq,0,sizeof(PacketQueue));
     memset (&f, 0, sizeof(Flow));
@@ -6679,7 +6666,6 @@ static int StreamTcpTest14 (void) {
     memset(&pq,0,sizeof(PacketQueue));
 
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset (&f, 0, sizeof(Flow));
     memset(&tv, 0, sizeof (ThreadVars));
     memset(&stt, 0, sizeof (StreamTcpThread));
@@ -6844,7 +6830,6 @@ static int StreamTcp4WHSTest01 (void) {
     StreamTcpThread stt;
     TCPHdr tcph;
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     PacketQueue pq;
     memset(&pq,0,sizeof(PacketQueue));
     memset (&f, 0, sizeof(Flow));
@@ -6926,7 +6911,6 @@ static int StreamTcp4WHSTest02 (void) {
     StreamTcpThread stt;
     TCPHdr tcph;
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     PacketQueue pq;
     memset(&pq,0,sizeof(PacketQueue));
     memset (&f, 0, sizeof(Flow));
@@ -6997,7 +6981,6 @@ static int StreamTcp4WHSTest03 (void) {
     StreamTcpThread stt;
     TCPHdr tcph;
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     PacketQueue pq;
     memset(&pq,0,sizeof(PacketQueue));
     memset (&f, 0, sizeof(Flow));
@@ -7085,7 +7068,6 @@ static int StreamTcpTest15 (void) {
     memset(&pq,0,sizeof(PacketQueue));
 
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset (&f, 0, sizeof(Flow));
     memset(&tv, 0, sizeof (ThreadVars));
     memset(&stt, 0, sizeof (StreamTcpThread));
@@ -7257,7 +7239,6 @@ static int StreamTcpTest16 (void) {
     memset(&pq,0,sizeof(PacketQueue));
 
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset (&f, 0, sizeof(Flow));
     memset(&tv, 0, sizeof (ThreadVars));
     memset(&stt, 0, sizeof (StreamTcpThread));
@@ -7430,7 +7411,6 @@ static int StreamTcpTest17 (void) {
     memset(&pq,0,sizeof(PacketQueue));
 
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset (&f, 0, sizeof(Flow));
     memset(&tv, 0, sizeof (ThreadVars));
     memset(&stt, 0, sizeof (StreamTcpThread));
@@ -7595,7 +7575,6 @@ static int StreamTcpTest18 (void) {
     memset(&addr, 0, sizeof(addr));
     memset(&stream, 0, sizeof(stream));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&ipv4h, 0, sizeof(ipv4h));
 
     StreamTcpInitConfig(TRUE);
@@ -7644,7 +7623,6 @@ static int StreamTcpTest19 (void) {
     memset(&addr, 0, sizeof(addr));
     memset(&stream, 0, sizeof(stream));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&ipv4h, 0, sizeof(ipv4h));
 
     StreamTcpInitConfig(TRUE);
@@ -7696,7 +7674,6 @@ static int StreamTcpTest20 (void) {
     memset(&addr, 0, sizeof(addr));
     memset(&stream, 0, sizeof(stream));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&ipv4h, 0, sizeof(ipv4h));
 
     StreamTcpInitConfig(TRUE);
@@ -7748,7 +7725,6 @@ static int StreamTcpTest21 (void) {
     memset(&addr, 0, sizeof(addr));
     memset(&stream, 0, sizeof(stream));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&ipv4h, 0, sizeof(ipv4h));
 
     StreamTcpInitConfig(TRUE);
@@ -7800,7 +7776,6 @@ static int StreamTcpTest22 (void) {
     memset(&addr, 0, sizeof(addr));
     memset(&stream, 0, sizeof(stream));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&ipv4h, 0, sizeof(ipv4h));
 
     StreamTcpInitConfig(TRUE);
@@ -7855,7 +7830,6 @@ static int StreamTcpTest23(void)
     memset(&pq,0,sizeof(PacketQueue));
     memset(&ssn, 0, sizeof (TcpSession));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&f, 0, sizeof (Flow));
     memset(&tcph, 0, sizeof (TCPHdr));
     memset(&tv, 0, sizeof (ThreadVars));
@@ -7950,7 +7924,6 @@ static int StreamTcpTest24(void)
 
     memset(&ssn, 0, sizeof (TcpSession));
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset(&f, 0, sizeof (Flow));
     memset(&tv, 0, sizeof (ThreadVars));
     memset(&tcph, 0, sizeof (TCPHdr));
@@ -8034,7 +8007,6 @@ static int StreamTcpTest25(void) {
     memset(&pq,0,sizeof(PacketQueue));
 
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset (&f, 0, sizeof(Flow));
     memset(&tv, 0, sizeof (ThreadVars));
     memset(&stt, 0, sizeof (StreamTcpThread));
@@ -8134,7 +8106,6 @@ static int StreamTcpTest26(void) {
     memset(&pq,0,sizeof(PacketQueue));
 
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset (&f, 0, sizeof(Flow));
     memset(&tv, 0, sizeof (ThreadVars));
     memset(&stt, 0, sizeof (StreamTcpThread));
@@ -8230,7 +8201,6 @@ static int StreamTcpTest27(void) {
     memset(&pq,0,sizeof(PacketQueue));
 
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset (&f, 0, sizeof(Flow));
     memset(&tv, 0, sizeof (ThreadVars));
     memset(&stt, 0, sizeof (StreamTcpThread));
@@ -9217,7 +9187,6 @@ static int StreamTcpTest37(void) {
     memset(&pq,0,sizeof(PacketQueue));
 
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
     memset (&f, 0, sizeof(Flow));
     memset(&tv, 0, sizeof (ThreadVars));
     memset(&stt, 0, sizeof (StreamTcpThread));
@@ -9350,7 +9319,6 @@ static int StreamTcpTest38 (void) {
     if (unlikely(p == NULL))
         return 0;
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
 
     p->flow = &f;
     tcph.th_win = htons(5480);
@@ -9469,7 +9437,6 @@ static int StreamTcpTest39 (void) {
     if (unlikely(p == NULL))
         return 0;
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
 
     p->flow = &f;
     tcph.th_win = htons(5480);
@@ -9698,7 +9665,6 @@ static int StreamTcpTest42 (void) {
     if (unlikely(p == NULL))
         return 0;
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
 
     memset(&pq,0,sizeof(PacketQueue));
     memset (&f, 0, sizeof(Flow));
@@ -9790,7 +9756,6 @@ static int StreamTcpTest43 (void) {
     if (unlikely(p == NULL))
         return 0;
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
 
     memset(&pq,0,sizeof(PacketQueue));
     memset (&f, 0, sizeof(Flow));
@@ -9882,7 +9847,6 @@ static int StreamTcpTest44 (void) {
     if (unlikely(p == NULL))
         return 0;
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
 
     memset(&pq,0,sizeof(PacketQueue));
     memset (&f, 0, sizeof(Flow));
@@ -9969,7 +9933,6 @@ static int StreamTcpTest45 (void) {
     if (unlikely(p == NULL))
         return 0;
     memset(p, 0, SIZE_OF_PACKET);
-    p->pkt = (uint8_t *)(p + 1);
 
     memset(&pq,0,sizeof(PacketQueue));
     memset (&f, 0, sizeof(Flow));