]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #2528 in SNORT/snort3 from ~DERAMADA/snort3:fix_inspection_clone...
authorSteve Chew (stechew) <stechew@cisco.com>
Tue, 6 Oct 2020 15:54:05 +0000 (15:54 +0000)
committerSteve Chew (stechew) <stechew@cisco.com>
Tue, 6 Oct 2020 15:54:05 +0000 (15:54 +0000)
Squashed commit of the following:

commit 8c1be3ae06b4c6e3e60e738433aebb36edfec81c
Author: deramada <deramada@cisco.com>
Date:   Fri Oct 2 12:52:51 2020 -0400

    policy: copy uuid, user_policy_id, and policy_mode when an inspection policy is cloned

src/main/policy.cc

index ef637275d2dec094ddef7277eea39de22c744d03..5c12f4438f0503cde735f0ffc1472a7359212f8c 100644 (file)
@@ -82,8 +82,14 @@ void InspectionPolicy::init(InspectionPolicy* other_inspection_policy)
     framework_policy = nullptr;
     cloned = false;
     if (other_inspection_policy)
+    {
         policy_id = other_inspection_policy->policy_id;
-
+        policy_mode = other_inspection_policy->policy_mode;
+        user_policy_id = other_inspection_policy->user_policy_id;
+#ifdef HAVE_UUID
+        uuid_copy(uuid, other_inspection_policy->uuid);
+#endif
+    }
     InspectorManager::new_policy(this, other_inspection_policy);
 }