From ca6b8e206fe3269369297bb12a70554608fe1986 Mon Sep 17 00:00:00 2001 From: zhengchao Date: Thu, 17 Sep 2020 15:52:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=85=8D=E7=BD=AE=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E6=9C=AA=E5=8A=A0=E5=88=A4=E6=96=AD=E7=9A=84=E8=B0=83?= =?UTF-8?q?=E7=94=A8Maat=5Ftable=5Fruntime=5Fapply=5Fnew=5Fip=5Fmatcher?= =?UTF-8?q?=EF=BC=8C=E5=AF=BC=E8=87=B4ip=5Fmatcher=E8=A2=AB=E6=B8=85?= =?UTF-8?q?=E7=A9=BA=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/entry/Maat_rule.cpp | 13 ++++++++----- src/entry/Maat_table_runtime.cpp | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/entry/Maat_rule.cpp b/src/entry/Maat_rule.cpp index 6d54746..e6c30e1 100644 --- a/src/entry/Maat_rule.cpp +++ b/src/entry/Maat_rule.cpp @@ -34,7 +34,7 @@ #include "stream_fuzzy_hash.h" #include "gram_index_engine.h" -int MAAT_FRAME_VERSION_3_0_20200822=1; +int MAAT_FRAME_VERSION_3_0_20200917=1; int is_valid_table_name(const char* str) { @@ -2309,11 +2309,14 @@ void do_scanner_update(struct Maat_scanner* scanner, int scan_thread_num, void* } break; case TABLE_TYPE_IP_PLUGIN: - Maat_table_runtime_ip_plugin_build_new_ip_matcher(table_rt); - old_ip_matcher=Maat_table_runtime_apply_new_ip_matcher(table_rt); - if(old_ip_matcher) + ret=Maat_table_runtime_ip_plugin_build_new_ip_matcher(table_rt); + if(ret) { - Maat_garbage_bagging(scanner->ref_garbage_bin, old_ip_matcher, (void (*)(void*))ip_matcher_free); + old_ip_matcher=Maat_table_runtime_apply_new_ip_matcher(table_rt); + if(old_ip_matcher) + { + Maat_garbage_bagging(scanner->ref_garbage_bin, old_ip_matcher, (void (*)(void*))ip_matcher_free); + } } break; default: diff --git a/src/entry/Maat_table_runtime.cpp b/src/entry/Maat_table_runtime.cpp index 75a5265..fe0c574 100644 --- a/src/entry/Maat_table_runtime.cpp +++ b/src/entry/Maat_table_runtime.cpp @@ -457,7 +457,7 @@ int Maat_table_runtime_ip_plugin_build_new_ip_matcher(struct Maat_table_runtime* free(exc_array); exc_array=NULL; ip_plugin->changed_flag=0; - return 0; + return 1; } struct ip_matcher* Maat_table_runtime_apply_new_ip_matcher(struct Maat_table_runtime* table_rt) {