From: Michael Altizer (mialtize) Date: Thu, 18 Jul 2019 10:59:14 +0000 (-0400) Subject: Merge pull request #1666 in SNORT/snort3 from ~YSAIRAM/snort3:iha to master X-Git-Tag: 3.0.0-259~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01e1d7d01a6120e8f631960dcc8a91092a500b19;p=thirdparty%2Fsnort3.git Merge pull request #1666 in SNORT/snort3 from ~YSAIRAM/snort3:iha to master Squashed commit of the following: commit 4c012d6cc44655bab71ece1dc52c480ad8aa1e0a Author: Y Sairam Date: Thu Jul 11 21:39:39 2019 -0400 flow: Bypass ha write for unsupported Tunnel flows --- diff --git a/src/flow/ha.cc b/src/flow/ha.cc index e24a69369..1bb8ed7b2 100644 --- a/src/flow/ha.cc +++ b/src/flow/ha.cc @@ -25,6 +25,7 @@ #include "framework/counts.h" #include "log/messages.h" +#include "packet_io/active.h" #include "packet_io/sfdaq_instance.h" #include "protocols/packet.h" #include "side_channel/side_channel.h" @@ -736,7 +737,7 @@ void HighAvailabilityManager::thread_term() void HighAvailabilityManager::process_update(Flow* flow, Packet* p) { - if (ha && p && flow) + if (ha && flow && !p->active->get_tunnel_bypass()) ha->process_update(flow, p); } diff --git a/src/flow/test/ha_test.cc b/src/flow/test/ha_test.cc index 7c61c2a36..7891efdbd 100644 --- a/src/flow/test/ha_test.cc +++ b/src/flow/test/ha_test.cc @@ -105,6 +105,7 @@ static uint8_t s_message_length = 0; static Flow s_flow; static FlowKey s_flowkey; static Packet s_pkt; +static Active active; static StreamHAClient* s_ha_client; static FlowHAClient* s_other_ha_client; static std::function s_handler = nullptr; @@ -438,6 +439,7 @@ TEST(high_availability_test, transmit_update_no_update) s_transmit_message_called = false; s_stream_update_required = false; s_other_update_required = false; + s_pkt.active = &active; HighAvailabilityManager::process_update(&s_flow, &s_pkt); CHECK(s_transmit_message_called == false); } @@ -447,6 +449,7 @@ TEST(high_availability_test, transmit_update_stream_only) s_transmit_message_called = false; s_stream_update_required = true; s_other_update_required = false; + s_pkt.active = &active; HighAvailabilityManager::process_update(&s_flow, &s_pkt); CHECK(s_transmit_message_called == true); } @@ -456,6 +459,7 @@ TEST(high_availability_test, transmit_update_both_update) s_transmit_message_called = false; s_stream_update_required = true; s_other_update_required = true; + s_pkt.active = &active; CHECK(s_other_ha_client->handle == 1); s_flow.ha_state->set_pending(s_other_ha_client->handle); HighAvailabilityManager::process_update(&s_flow, &s_pkt);