diff --git a/src/decode-ipv4.c b/src/decode-ipv4.c index df8b8ddba253..3bf413ef63ca 100644 --- a/src/decode-ipv4.c +++ b/src/decode-ipv4.c @@ -523,7 +523,7 @@ int DecodeIPV4(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, uint8_t *pkt, u /* do the actual decoding */ if (unlikely(DecodeIPV4Packet (p, pkt, len) < 0)) { SCLogDebug("decoding IPv4 packet failed"); - p->ip4h = NULL; + CLEAR_IPV4_PACKET((p)); return TM_ECODE_FAILED; } p->proto = IPV4_GET_IPPROTO(p); diff --git a/src/decode-ipv6.c b/src/decode-ipv6.c index ce97b501ffbc..ecb6647399c8 100644 --- a/src/decode-ipv6.c +++ b/src/decode-ipv6.c @@ -590,7 +590,7 @@ int DecodeIPV6(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, uint8_t *pkt, u /* do the actual decoding */ ret = DecodeIPV6Packet (tv, dtv, p, pkt, len); if (unlikely(ret < 0)) { - p->ip6h = NULL; + CLEAR_IPV6_PACKET(p); return TM_ECODE_FAILED; } diff --git a/src/decode-sctp.c b/src/decode-sctp.c index f787933ebd9d..5d1796da7d61 100644 --- a/src/decode-sctp.c +++ b/src/decode-sctp.c @@ -64,7 +64,7 @@ int DecodeSCTP(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, uint8_t *pkt, u StatsIncr(tv, dtv->counter_sctp); if (unlikely(DecodeSCTPPacket(tv, p,pkt,len) < 0)) { - p->sctph = NULL; + CLEAR_SCTP_PACKET(p); return TM_ECODE_FAILED; } diff --git a/src/decode-tcp.c b/src/decode-tcp.c index 0e3327ec67c9..4d4c913c6c45 100644 --- a/src/decode-tcp.c +++ b/src/decode-tcp.c @@ -203,7 +203,7 @@ int DecodeTCP(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, uint8_t *pkt, ui if (unlikely(DecodeTCPPacket(tv, p,pkt,len) < 0)) { SCLogDebug("invalid TCP packet"); - p->tcph = NULL; + CLEAR_TCP_PACKET(p); return TM_ECODE_FAILED; } diff --git a/src/decode-udp.c b/src/decode-udp.c index 7a90653f12b3..60141f52d387 100644 --- a/src/decode-udp.c +++ b/src/decode-udp.c @@ -76,7 +76,7 @@ int DecodeUDP(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, uint8_t *pkt, ui StatsIncr(tv, dtv->counter_udp); if (unlikely(DecodeUDPPacket(tv, p,pkt,len) < 0)) { - p->udph = NULL; + CLEAR_UDP_PACKET(p); return TM_ECODE_FAILED; }