From: Victor Julien Date: Fri, 5 Nov 2021 19:09:17 +0000 (+0100) Subject: packetpool: ReleasePacket callback check on getter X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=373278438d425983e743c997c102639832e11681;p=people%2Fms%2Fsuricata.git packetpool: ReleasePacket callback check on getter Any packet coming from the pool should have `PacketPoolReturnPacket` as its callback. Check that this is the case. --- diff --git a/src/decode.c b/src/decode.c index d75c63752..96b21b7df 100644 --- a/src/decode.c +++ b/src/decode.c @@ -67,6 +67,7 @@ #include "output.h" #include "output-flow.h" #include "flow-storage.h" +#include "util-validate.h" uint32_t default_packet_size = 0; extern bool stats_decoder_events; @@ -194,6 +195,7 @@ Packet *PacketGetFromQueueOrAlloc(void) /* non fatal, we're just not processing a packet then */ p = PacketGetFromAlloc(); } else { + DEBUG_VALIDATE_BUG_ON(p->ReleasePacket != PacketPoolReturnPacket); PACKET_PROFILING_START(p); }