]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #1666 in SNORT/snort3 from ~YSAIRAM/snort3:iha to master
authorMichael Altizer (mialtize) <mialtize@cisco.com>
Thu, 18 Jul 2019 10:59:14 +0000 (06:59 -0400)
committerMichael Altizer (mialtize) <mialtize@cisco.com>
Thu, 18 Jul 2019 10:59:14 +0000 (06:59 -0400)
Squashed commit of the following:

commit 4c012d6cc44655bab71ece1dc52c480ad8aa1e0a
Author: Y Sairam <ysairam@cisco.com>
Date:   Thu Jul 11 21:39:39 2019 -0400

    flow: Bypass ha write for unsupported Tunnel flows

src/flow/ha.cc
src/flow/test/ha_test.cc

index e24a69369237a254a17bdf94898ed1cfd8be6767..1bb8ed7b21cfc96a87560f4bd9224c9d0473c61b 100644 (file)
@@ -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);
 }
 
index 7c61c2a36d0791ad70b7669b2d71bfe5a0fc009d..7891efdbd5198dc9be80379761c4f35f5090888e 100644 (file)
@@ -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<void (SCMessage*)> 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);