1.fix dict feature parsing error 2.support proto judgment
This commit is contained in:
parent
f03aab2927
commit
9521c1af57
@ -134,11 +134,14 @@ int __add_app_feature(int appid,
|
||||
|
||||
if (begin != dict) {
|
||||
strncpy(pos, begin, p - begin);
|
||||
k_sscanf(pos, "%d:%x",&index, &value);
|
||||
node->pos_info[node->pos_num].pos = index;
|
||||
node->pos_info[node->pos_num].value = value;
|
||||
node->pos_num++;
|
||||
}
|
||||
else{
|
||||
strcpy(pos, dict);
|
||||
}
|
||||
k_sscanf(pos, "%d:%x",&index, &value);
|
||||
node->pos_info[node->pos_num].pos = index;
|
||||
node->pos_info[node->pos_num].value = value;
|
||||
node->pos_num++;
|
||||
feature_list_write_lock();
|
||||
list_add(&(node->head), &af_feature_head);
|
||||
feature_list_write_unlock();
|
||||
@ -659,7 +662,8 @@ int af_match_one(flow_info_t *flow, af_feature_node_t *node)
|
||||
AF_ERROR("node or flow is NULL\n");
|
||||
return AF_FALSE;
|
||||
}
|
||||
|
||||
if (node->proto > 0 && flow->l4_protocol != node->proto)
|
||||
return AF_FALSE;
|
||||
if (flow->l4_len == 0)
|
||||
return AF_FALSE;
|
||||
|
||||
|
@ -236,7 +236,6 @@ int af_set_mac_list(cJSON * data_obj)
|
||||
return -1;
|
||||
}
|
||||
if (-1 == mac_to_hex(mac_obj->valuestring, mac_hex)){
|
||||
AF_ERROR("mac format error: %s\n", mac_obj->valuestring);
|
||||
continue;
|
||||
}
|
||||
af_mac_add(mac_hex);
|
||||
|
Loading…
Reference in New Issue
Block a user