多线程访问pme的时候增加锁
This commit is contained in:
@@ -195,6 +195,7 @@ static int index_of_enforce_policy(struct Maat_rule_t* result, size_t size)
|
||||
}
|
||||
return ret_intercept_idx;
|
||||
}
|
||||
|
||||
enum kni_action intercept_policy_scan(struct kni_maat_handle* handle, struct ipaddr *addr, char *domain, int domain_len, int thread_seq, int *policy_id, int *is_hit_policy){
|
||||
//return KNI_ACTION_INTERCEPT;
|
||||
Maat_feather_t maat_feather=handle->feather;
|
||||
@@ -225,7 +226,8 @@ enum kni_action intercept_policy_scan(struct kni_maat_handle* handle, struct ipa
|
||||
enforced_policy_idx=index_of_enforce_policy(result, hit_policy_cnt);
|
||||
*policy_id=result[enforced_policy_idx].config_id;
|
||||
*is_hit_policy=1;
|
||||
return (enum kni_action)result[enforced_policy_idx].action;
|
||||
unsigned char action = (unsigned char)result[enforced_policy_idx].action;
|
||||
return (enum kni_action)action;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -243,7 +245,7 @@ enum kni_action intercept_policy_scan(struct kni_maat_handle* handle, struct ipa
|
||||
0x60: steer
|
||||
0x80: bypass
|
||||
*/
|
||||
int kni_maat_action_trans(int action, char *action_str){
|
||||
int kni_maat_action_trans(enum kni_action action, char *action_str){
|
||||
switch(action){
|
||||
case 0x00:
|
||||
strcpy(action_str, "none");
|
||||
|
||||
Reference in New Issue
Block a user