TSG-14946: 安全策略支持allow(deny)和monitor动作同时命中

This commit is contained in:
刘学利
2023-05-27 09:37:46 +00:00
parent bc7909e57b
commit 7abc576621
14 changed files with 183 additions and 299 deletions

View File

@@ -219,6 +219,7 @@ static int dns_set_answer_records(char *payload, int payload_len, struct dns_ans
unsigned char do_action_redirect_dns(const struct streaminfo *a_stream, struct maat_rule *p_result, struct compile_user_region *user_region, const void *user_data)
{
int opt_value=0;
int ret=0,used_len=0,record_num=0;
unsigned char raw_route_dir=0;
char payload[1024]={0};
@@ -247,7 +248,8 @@ unsigned char do_action_redirect_dns(const struct streaminfo *a_stream, struct m
ret=dns_set_response_question(payload+used_len, payload_len-used_len, &(dns_info->query_question));
if(ret==-1)
{
return STATE_GIVEME|STATE_DROPPKT;
MESA_set_stream_opt(a_stream, MSO_DROP_CURRENT_PKT, (void *)&opt_value, sizeof(opt_value));
return STATE_GIVEME;
}
used_len+=ret;
@@ -263,6 +265,8 @@ unsigned char do_action_redirect_dns(const struct streaminfo *a_stream, struct m
raw_route_dir=(dns_info->hdr_info.qr==0) ? MESA_dir_reverse(a_stream->routedir) : a_stream->routedir;
tsg_send_inject_packet(a_stream, SIO_DEFAULT, payload, used_len, raw_route_dir);
return STATE_GIVEME|STATE_DROPPKT;
MESA_set_stream_opt(a_stream, MSO_DROP_CURRENT_PKT, (void *)&opt_value, sizeof(opt_value));
return STATE_GIVEME;
}