bugfix:同一个Object下,存在相同内容的item,导致命中路径Object重复
This commit is contained in:
@@ -1144,6 +1144,7 @@ int http_hit_policy_list(struct verify_policy_query *verify_policy, int num, siz
|
|||||||
bool succeeded = false;
|
bool succeeded = false;
|
||||||
size_t rules=0, i=0,j=0;
|
size_t rules=0, i=0,j=0;
|
||||||
int result_config[MAX_SCAN_RESULT] = {0};
|
int result_config[MAX_SCAN_RESULT] = {0};
|
||||||
|
int result_object_id[512] = {0};
|
||||||
|
|
||||||
int vsys_id = verify_policy->vsys_id;
|
int vsys_id = verify_policy->vsys_id;
|
||||||
int compile_table_id = verify_policy->compile_table_id;
|
int compile_table_id = verify_policy->compile_table_id;
|
||||||
@@ -1202,6 +1203,7 @@ int http_hit_policy_list(struct verify_policy_query *verify_policy, int num, siz
|
|||||||
}
|
}
|
||||||
cJSON_AddItemToArray(hit_obj, policy_obj);
|
cJSON_AddItemToArray(hit_obj, policy_obj);
|
||||||
result_config[i] = ctx->hit_rules[i].config_id;
|
result_config[i] = ctx->hit_rules[i].config_id;
|
||||||
|
memset(result_object_id, 0, sizeof(result_object_id));
|
||||||
|
|
||||||
topObjectList=cJSON_CreateArray();
|
topObjectList=cJSON_CreateArray();
|
||||||
cJSON_AddItemToObject(policy_obj, "topObjectList", topObjectList);
|
cJSON_AddItemToObject(policy_obj, "topObjectList", topObjectList);
|
||||||
@@ -1209,8 +1211,13 @@ int http_hit_policy_list(struct verify_policy_query *verify_policy, int num, siz
|
|||||||
{
|
{
|
||||||
if(ctx->hit_path[j].compile_id > 0 && ctx->hit_path[j].compile_id == ctx->hit_rules[i].config_id)
|
if(ctx->hit_path[j].compile_id > 0 && ctx->hit_path[j].compile_id == ctx->hit_rules[i].config_id)
|
||||||
{
|
{
|
||||||
|
if(http_hit_policy_match(result_object_id, j, ctx->hit_path[j].top_group_id))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
topObject=cJSON_CreateObject();
|
topObject=cJSON_CreateObject();
|
||||||
cJSON_AddNumberToObject(topObject, "objectId", ctx->hit_path[j].top_group_id);
|
cJSON_AddNumberToObject(topObject, "objectId", ctx->hit_path[j].top_group_id);
|
||||||
|
result_object_id[j] = ctx->hit_path[j].top_group_id;
|
||||||
get_attributes_table_name(verify_policy->verify_object, num, ctx->hit_path[j].Nth_scan, &ctx->ip_ctx, ctx->tunnel_endpoint_x, topObject);
|
get_attributes_table_name(verify_policy->verify_object, num, ctx->hit_path[j].Nth_scan, &ctx->ip_ctx, ctx->tunnel_endpoint_x, topObject);
|
||||||
cJSON_AddItemToArray(topObjectList, topObject);
|
cJSON_AddItemToArray(topObjectList, topObject);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user