tun模式下多线程直接退出, 统一名称修改
This commit is contained in:
@@ -2248,6 +2248,10 @@ extern "C" int kni_init(){
|
||||
|
||||
//init tun
|
||||
if(g_kni_handle->deploy_mode == KNI_DEPLOY_MODE_TUN){
|
||||
if(g_kni_handle->thread_count != 1){
|
||||
KNI_LOG_ERROR(local_logger, "Tun mode, thread count must be 1, while it's %d", g_kni_handle->thread_count);
|
||||
goto error_out;
|
||||
}
|
||||
char tun_name[KNI_SYMBOL_MAX];
|
||||
ret = MESA_load_profile_string_nodef(profile, section, "tun_name", tun_name, sizeof(tun_name));
|
||||
if(ret < 0){
|
||||
|
||||
@@ -6,7 +6,7 @@ enum scan_table
|
||||
{
|
||||
PXY_INTERCEPT_IP,
|
||||
PXY_INTERCEPT_DOMAIN,
|
||||
TSG_OBJ_SUBSCRIBE_ID,
|
||||
TSG_OBJ_SUBSCRIBER_ID,
|
||||
SCAN_TABLE_MAX
|
||||
};
|
||||
|
||||
@@ -201,7 +201,7 @@ struct kni_maat_handle* kni_maat_init(const char* profile, void *logger, int thr
|
||||
//static maat
|
||||
const char *table_name[SCAN_TABLE_MAX];
|
||||
char tablename_intercept_compile[] = "PXY_INTERCEPT_COMPILE";
|
||||
char tablename_subscriber_id[] = "TSG_DYN_SUBSCRIBE_IP";
|
||||
char tablename_subscriber_id[] = "TSG_DYN_SUBSCRIBER_IP";
|
||||
int ret, i;
|
||||
handle->static_maat = create_maat_feather("static", profile, "static_maat", logger, thread_count);
|
||||
if(handle->static_maat == NULL){
|
||||
@@ -209,7 +209,7 @@ struct kni_maat_handle* kni_maat_init(const char* profile, void *logger, int thr
|
||||
}
|
||||
table_name[PXY_INTERCEPT_IP] = "PXY_INTERCEPT_IP";
|
||||
table_name[PXY_INTERCEPT_DOMAIN] = "PXY_INTERCEPT_DOMAIN";
|
||||
table_name[TSG_OBJ_SUBSCRIBE_ID] = "TSG_OBJ_SUBSCRIBE_ID";
|
||||
table_name[TSG_OBJ_SUBSCRIBER_ID] = "TSG_OBJ_SUBSCRIBER_ID";
|
||||
for(i = 0; i < SCAN_TABLE_MAX; i++){
|
||||
handle->scan_tableid[i] = Maat_table_register(handle->static_maat, table_name[i]);
|
||||
if(handle->scan_tableid[i] < 0){
|
||||
@@ -318,7 +318,7 @@ enum kni_action intercept_policy_scan(struct kni_maat_handle* handle, struct ipa
|
||||
source_subscribe_id = (char*)Maat_plugin_get_EX_data(handle->dynamic_maat, handle->subscriber_id_tableid, sip);
|
||||
dest_subscribe_id = (char*)Maat_plugin_get_EX_data(handle->dynamic_maat, handle->subscriber_id_tableid, dip);
|
||||
if(source_subscribe_id != NULL){
|
||||
scan_ret = Maat_full_scan_string(handle->static_maat, handle->scan_tableid[TSG_OBJ_SUBSCRIBE_ID],
|
||||
scan_ret = Maat_full_scan_string(handle->static_maat, handle->scan_tableid[TSG_OBJ_SUBSCRIBER_ID],
|
||||
CHARSET_UTF8, source_subscribe_id, strlen(source_subscribe_id),
|
||||
result+hit_policy_cnt, NULL, KNI_MAAT_RULE_NUM_MAX-hit_policy_cnt,
|
||||
&scan_mid, thread_seq);
|
||||
@@ -328,7 +328,7 @@ enum kni_action intercept_policy_scan(struct kni_maat_handle* handle, struct ipa
|
||||
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],
|
||||
scan_ret = Maat_full_scan_string(handle->static_maat, handle->scan_tableid[TSG_OBJ_SUBSCRIBER_ID],
|
||||
CHARSET_UTF8, dest_subscribe_id, strlen(dest_subscribe_id),
|
||||
result+hit_policy_cnt, NULL, KNI_MAAT_RULE_NUM_MAX-hit_policy_cnt,
|
||||
&scan_mid, thread_seq);
|
||||
|
||||
Reference in New Issue
Block a user