diff --git a/src/decode-ipv4.c b/src/decode-ipv4.c index 6c2998cc6d74..5d9d12a8b93e 100644 --- a/src/decode-ipv4.c +++ b/src/decode-ipv4.c @@ -524,7 +524,7 @@ int DecodeIPV4(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, /* 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 f57b1d34e13f..b20440145ac7 100644 --- a/src/decode-ipv6.c +++ b/src/decode-ipv6.c @@ -584,7 +584,7 @@ int DecodeIPV6(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, const uint8_t * /* do the actual decoding */ int 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 6de50d41b0fe..0346dfb3e2ed 100644 --- a/src/decode-sctp.c +++ b/src/decode-sctp.c @@ -65,7 +65,7 @@ int DecodeSCTP(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, 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 b4aeb0e4bf84..c3f0ad240aa3 100644 --- a/src/decode-tcp.c +++ b/src/decode-tcp.c @@ -238,7 +238,7 @@ int DecodeTCP(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, 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 436b10a132f5..a4bb1dd5eda6 100644 --- a/src/decode-udp.c +++ b/src/decode-udp.c @@ -77,7 +77,7 @@ int DecodeUDP(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, StatsIncr(tv, dtv->counter_udp); if (unlikely(DecodeUDPPacket(tv, p, pkt,len) < 0)) { - p->udph = NULL; + CLEAR_UDP_PACKET(p); return TM_ECODE_FAILED; }