|
|
|
|
@ -769,46 +769,6 @@ void CaptureStatsSetup(ThreadVars *tv, CaptureStats *s);
|
|
|
|
|
} \
|
|
|
|
|
} while(0)
|
|
|
|
|
|
|
|
|
|
/** \brief issue drop action
|
|
|
|
|
*
|
|
|
|
|
* Set drop (+reject) flags in both current and root packet.
|
|
|
|
|
*
|
|
|
|
|
* \param action action bit flags. Must be limited to ACTION_DROP_REJECT
|
|
|
|
|
*/
|
|
|
|
|
static inline void PacketDrop(Packet *p, const uint8_t action, enum PacketDropReason r)
|
|
|
|
|
{
|
|
|
|
|
BUG_ON((action & ~ACTION_DROP_REJECT) != 0);
|
|
|
|
|
|
|
|
|
|
if (p->drop_reason == PKT_DROP_REASON_NOT_SET)
|
|
|
|
|
p->drop_reason = (uint8_t)r;
|
|
|
|
|
|
|
|
|
|
if (p->root) {
|
|
|
|
|
p->root->action |= action;
|
|
|
|
|
if (p->root->drop_reason == PKT_DROP_REASON_NOT_SET) {
|
|
|
|
|
p->root->drop_reason = PKT_DROP_REASON_INNER_PACKET;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
p->action |= action;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline uint8_t PacketCheckAction(const Packet *p, const uint8_t a)
|
|
|
|
|
{
|
|
|
|
|
if (likely(p->root == NULL)) {
|
|
|
|
|
return (p->action & a) != 0;
|
|
|
|
|
} else {
|
|
|
|
|
/* check against both */
|
|
|
|
|
const uint8_t actions = p->action | p->root->action;
|
|
|
|
|
return (actions & a) != 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifdef UNITTESTS
|
|
|
|
|
static inline uint8_t PacketTestAction(const Packet *p, const uint8_t a)
|
|
|
|
|
{
|
|
|
|
|
return PacketCheckAction(p, a);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#define TUNNEL_INCR_PKT_RTV_NOLOCK(p) do { \
|
|
|
|
|
((p)->root ? (p)->root->tunnel_rtv_cnt++ : (p)->tunnel_rtv_cnt++); \
|
|
|
|
|
} while (0)
|
|
|
|
|
|