traffic mirror对不合法的intercept policy判空,避免段错误
This commit is contained in:
@@ -25,8 +25,15 @@ void policy_table_ex_data_dup_cb(int table_id, MAAT_PLUGIN_EX_DATA * to,
|
|||||||
MAAT_PLUGIN_EX_DATA * from, long argl, void * argp)
|
MAAT_PLUGIN_EX_DATA * from, long argl, void * argp)
|
||||||
{
|
{
|
||||||
struct policy_table_ex_data * ex_data = (struct policy_table_ex_data *)*from;
|
struct policy_table_ex_data * ex_data = (struct policy_table_ex_data *)*from;
|
||||||
__sync_add_and_fetch(&ex_data->atomic_refcnt, 1);
|
if(ex_data==NULL)
|
||||||
*to = (void *)ex_data;
|
{
|
||||||
|
*to=NULL;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
__sync_add_and_fetch(&ex_data->atomic_refcnt, 1);
|
||||||
|
*to = (void *)ex_data;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void policy_table_ex_data_free_cb(int table_id, MAAT_PLUGIN_EX_DATA * ad, long argl, void * argp)
|
void policy_table_ex_data_free_cb(int table_id, MAAT_PLUGIN_EX_DATA * ad, long argl, void * argp)
|
||||||
|
|||||||
Reference in New Issue
Block a user