From 3741ecd4d7dd287533e67577d44f5837035966c2 Mon Sep 17 00:00:00 2001 From: songyanchao Date: Sun, 14 Apr 2024 12:07:39 +0800 Subject: 🐞 fix: Fixed an issue where the Classifier rule change check behaved abnormally when multiple virtual systems shared the same rule set. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed an issue where the Classifier rule change check behaved abnormally when multiple virtual systems shared the same rule set. --- service/src/node_classifier.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/service/src/node_classifier.c b/service/src/node_classifier.c index 22374b5..2ad96c8 100644 --- a/service/src/node_classifier.c +++ b/service/src/node_classifier.c @@ -50,15 +50,15 @@ static inline int classifier_rules_changed(struct rule_list_parsed * old_rules, return RT_SUCCESS; } - for (uint32_t index = 0; index < old_rules->nr_rules; index++) + for (uint32_t new_index = 0; new_index < new_rules->nr_rules; new_index++) { int is_found = 0; - struct rule_field_parser * new_rule = &new_rules->rules[index]; + struct rule_field_parser * new_rule = &new_rules->rules[new_index]; for (uint32_t old_index = 0; old_index < old_rules->nr_rules; old_index++) { struct rule_field_parser * old_rule = &old_rules->rules[old_index]; - if (new_rule->rule_id == old_rule->rule_id) + if ((new_rule->rule_id == old_rule->rule_id) && (new_rule->priority == old_rule->priority)) { if (memcmp(new_rule, old_rule, sizeof(struct rule_field_parser)) != 0) { -- cgit v1.2.3