Squashed commit of the following:
commit
2a913fe450cc4d25ed02fed62827c97c98b83791
Author: Bhagya Tholpady <bbantwal@cisco.com>
Date: Tue Nov 19 14:35:19 2019 -0500
detection: disable rule evaluation when detection is disabled for offload packets
commit
520f55a8bfea4f6b43b5a452e9beaad6dfa837c0
Author: Bhagya Tholpady <bbantwal@cisco.com>
Date: Tue Nov 19 12:53:21 2019 -0500
flow: check if there are offloaded packets in the flow before clearing out the alert count
commit
12163b08cc3718f82b1df982dee826aff31ec7b8
Author: Bhagya Tholpady <bbantwal@cisco.com>
Date: Mon Nov 18 14:26:24 2019 -0500
detection: move the inspector manager thread local flag used to determine whether or not to call inspector clear to context
ContextSwitcher* sw = Analyzer::get_switcher();
sw->resume(p->context);
-
- fp_complete(p);
+
+ if ( p->is_detection_enabled(p->packet_flags & PKT_FROM_CLIENT) )
+ fp_complete(p);
}
void DetectionEngine::resume(Packet* p)
active_rules = CONTENT;
check_tags = false;
+ clear_inspectors = false;
}
IpsContext::~IpsContext()
ActiveRules active_rules;
State state;
bool check_tags;
+ bool clear_inspectors;
static const unsigned buf_size = Codec::PKT_MAX;
static bool s_sorted = false;
static THREAD_LOCAL vector<PHGlobal>* s_tl_handlers = nullptr;
-static THREAD_LOCAL bool s_clear = false;
struct FrameworkConfig
{
else if ( flow->gadget && flow->gadget->likes(p) )
{
flow->gadget->eval(p);
- s_clear = true;
+ p->context->clear_inspectors = true;
}
}
void InspectorManager::clear(Packet* p)
{
- if ( !s_clear )
+ if ( !p->context->clear_inspectors )
return;
if ( p->flow and p->flow->gadget )
p->flow->gadget->clear(p);
- s_clear = false;
+ p->context->clear_inspectors = false;
}
StreamAlertInfo* ai = trs.tracker->alerts + i;
Stream::log_extra_data(flow, trs.xtradata_mask, ai->event_id, ai->event_second);
}
- trs.tracker->alert_count = 0;
+ if ( !flow->is_suspended() )
+ trs.tracker->alert_count = 0;
}
void TcpReassembler::purge_to_seq(TcpReassemblerState& trs, uint32_t flush_seq)