decode: validate if dropped packet has drop reason

Related to
Bug #5458
pull/7767/head
Juliana Fajardini 3 years ago committed by Victor Julien
parent 1f54e8611a
commit abd595d695

@ -49,6 +49,7 @@
#include "util-error.h"
#include "util-profiling.h"
#include "util-device.h"
#include "util-validate.h"
/* Number of freed packet to save for one pool before freeing them. */
#define MAX_PENDING_RETURN_PACKETS 32
@ -450,6 +451,11 @@ void TmqhOutputPacketpool(ThreadVars *t, Packet *p)
SCLogDebug("tunnel stuff done, move on (proot %d)", proot);
}
/* Check that the drop reason has been set, if we have a drop */
if (PacketTestAction(p, ACTION_DROP)) {
DEBUG_VALIDATE_BUG_ON((p)->drop_reason == PKT_DROP_REASON_NOT_SET);
}
/* we're done with the tunnel root now as well */
if (proot == true) {
SCLogDebug("getting rid of root pkt... alloc'd %s", p->root->flags & PKT_ALLOC ? "true" : "false");

Loading…
Cancel
Save