From 660d2c07c13c750f4c903e9688e130f0999f9f54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B4=94=E4=B8=80=E9=B8=A3?= Date: Wed, 25 Sep 2019 13:17:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AF=BB=E5=8F=96subscrible?= =?UTF-8?q?=20id=E7=9A=84=E4=B8=80=E4=BA=9Bbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- conf/maat/dynamic_maat_tableinfo.conf | 2 +- entry/src/kni_maat.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/conf/maat/dynamic_maat_tableinfo.conf b/conf/maat/dynamic_maat_tableinfo.conf index 9f9b93d..020a7c2 100644 --- a/conf/maat/dynamic_maat_tableinfo.conf +++ b/conf/maat/dynamic_maat_tableinfo.conf @@ -1 +1 @@ -1 TSG_DYN_SUBSCRIBE_IP plugin {"key":1,"valid":5} \ No newline at end of file +1 TSG_DYN_SUBSCRIBE_IP plugin {"key":3,"valid":5} \ No newline at end of file diff --git a/entry/src/kni_maat.cpp b/entry/src/kni_maat.cpp index ca88fcf..db82e0e 100644 --- a/entry/src/kni_maat.cpp +++ b/entry/src/kni_maat.cpp @@ -177,7 +177,7 @@ void subscribe_id_new_cb(int table_id, const char* key, const char* table_line, int ret = 0; size_t subscribe_id_offset, len; void *logger = argp; - ret = get_column_pos(table_line, 7, &subscribe_id_offset, &len); + ret = get_column_pos(table_line, 4, &subscribe_id_offset, &len); if(ret<0){ KNI_LOG_ERROR(logger, "Add subscribe ID faild: %s", table_line); return; @@ -325,6 +325,7 @@ enum kni_action intercept_policy_scan(struct kni_maat_handle* handle, struct ipa if(scan_ret > 0){ hit_policy_cnt += scan_ret; } + free(source_subscribe_id); } if(dest_subscribe_id != NULL){ scan_ret = Maat_full_scan_string(handle->static_maat, handle->scan_tableid[TSG_OBJ_SUBSCRIBE_ID], @@ -334,6 +335,7 @@ enum kni_action intercept_policy_scan(struct kni_maat_handle* handle, struct ipa if(scan_ret > 0){ hit_policy_cnt += scan_ret; } + free(dest_subscribe_id); } //tcp: 6, udp: 17, can't be 0 scan_ret = Maat_scan_proto_addr(handle->static_maat, handle->scan_tableid[PXY_INTERCEPT_IP], addr, 6,