1 Commits

Author SHA1 Message Date
刘学利
ab097e3bff 命中策略后返回GIVEME,处理链接上后续的DNS请求
用户自定义没有符合的欺骗IP时,串联环境丢弃真实应答包
2021-04-17 13:38:01 +00:00

View File

@@ -156,7 +156,7 @@ static char fw_dns_action(struct streaminfo *a_stream, dns_info_t *dns_info, Maa
tmp_buff=NULL; tmp_buff=NULL;
} }
return PROT_STATE_GIVEME; return PROT_STATE_GIVEME|PROT_STATE_DROPPKT;
} }
item=cJSON_GetObjectItem(object, "method"); item=cJSON_GetObjectItem(object, "method");
@@ -168,7 +168,7 @@ static char fw_dns_action(struct streaminfo *a_stream, dns_info_t *dns_info, Maa
switch(method_type) switch(method_type)
{ {
case TSG_METHOD_TYPE_DROP: case TSG_METHOD_TYPE_DROP:
state=PROT_STATE_DROPME|PROT_STATE_DROPPKT; state=PROT_STATE_GIVEME|PROT_STATE_DROPPKT;
break; break;
case TSG_METHOD_TYPE_REDIRECTION: case TSG_METHOD_TYPE_REDIRECTION:
if(g_fw_dns_plug_info.mode==0 && dns_info->hdr_info.qr==1) //mirror if(g_fw_dns_plug_info.mode==0 && dns_info->hdr_info.qr==1) //mirror
@@ -268,7 +268,7 @@ static char fw_dns_action(struct streaminfo *a_stream, dns_info_t *dns_info, Maa
); );
} }
state=PROT_STATE_DROPME|PROT_STATE_DROPPKT; state=PROT_STATE_GIVEME|PROT_STATE_DROPPKT;
} }
else else
{ {
@@ -284,7 +284,7 @@ static char fw_dns_action(struct streaminfo *a_stream, dns_info_t *dns_info, Maa
dns_info->query_question.qtype, dns_info->query_question.qtype,
(g_fw_dns_plug_info.level<RLOG_LV_FATAL ? printaddr(&a_stream->addr, a_stream->threadnum) : "") (g_fw_dns_plug_info.level<RLOG_LV_FATAL ? printaddr(&a_stream->addr, a_stream->threadnum) : "")
); );
state=PROT_STATE_GIVEME; state=PROT_STATE_GIVEME|PROT_STATE_DROPPKT;
} }
break; break;
default: default: