diff --git a/platform/src/verify_matcher.cpp b/platform/src/verify_matcher.cpp index 4546afa..364d57c 100644 --- a/platform/src/verify_matcher.cpp +++ b/platform/src/verify_matcher.cpp @@ -1742,23 +1742,21 @@ int get_tunnel_type_table_id(char *tunnel_type) for (i = 0; i < sizeof(tunnel_type_map) / sizeof(const char *); i++) { if (0 == strcasecmp(tunnel_type, tunnel_type_map[i])) + { + if(i == 0) + { + table_id = TSG_OBJ_TUNNEL_GTP_ENDPOINT; + } + if(i == 1) + { + table_id = TSG_OBJ_TUNNEL_GRE_ENDPOINT; + } + if(i == 2) + { + table_id = TSG_OBJ_TUNNEL_IP_IN_IP_ENDPOINT; + } break; - } - - switch (i) - { - case 0: - table_id = TSG_OBJ_TUNNEL_GTP_ENDPOINT; - break; - case 1: - table_id = TSG_OBJ_TUNNEL_GRE_ENDPOINT; - break; - case 2: - table_id = TSG_OBJ_TUNNEL_IP_IN_IP_ENDPOINT; - break; - default: - table_id = TSG_OBJ_TUNNEL_GTP_ENDPOINT; - break; + } } return table_id; } @@ -1775,8 +1773,8 @@ int tunnel_scan(struct request_query_obj *request, struct policy_scan_ctx *ctx, if(ctx->tunnel_scan_mid == NULL) { ctx->tunnel_scan_mid = maat_state_new(g_policy_rt->feather[vsys_id], ctx->thread_id); + maat_state_set_scan_compile_table(ctx->tunnel_scan_mid, g_policy_rt->compile_table_id[TSG_TUNNEL]); } - maat_state_set_scan_compile_table(ctx->tunnel_scan_mid, g_policy_rt->compile_table_id[TSG_TUNNEL]); int tunnel_table_id = get_tunnel_type_table_id(request->tunnel_type); if (ip_addr->addrtype == ADDR_TYPE_IPV4) diff --git a/platform/src/verify_policy.cpp b/platform/src/verify_policy.cpp index 8b4666c..e593f76 100644 --- a/platform/src/verify_policy.cpp +++ b/platform/src/verify_policy.cpp @@ -365,10 +365,11 @@ static int get_attribute_from_json(int curr_id, cJSON* subchild, struct verify_p goto finish; } - tunnelType_item = cJSON_GetObjectItem(attributeValue,"tunnel_type"); + tunnelType_item = cJSON_GetObjectItem(attributeValue,"tunnelType"); if(tunnelType_item && tunnelType_item->type==cJSON_String) { policy_query->request_object[curr_id].tunnel_type=tunnelType_item->valuestring; + p += snprintf(p, sizeof(buff) - (p - buff), ", tunnelType=%s",policy_query->request_object[curr_id].tunnel_type); } if(0 == strcasecmp(attribute_type, "ip"))