6 Commits

Author SHA1 Message Date
刘学利
ab097e3bff 命中策略后返回GIVEME,处理链接上后续的DNS请求
用户自定义没有符合的欺骗IP时,串联环境丢弃真实应答包
2021-04-17 13:38:01 +00:00
杨威
badd5547da Update fw_dns_plug.cpp 2020-12-25 15:08:19 +08:00
杨威
95bdca7514 Merge branch 'patch-1' into 'master'
Update .gitlab-ci.yml testing源仅debug版开启asan

See merge request tango/fw_dns_plug!7
2020-10-30 23:22:39 +08:00
杨威
9e4ed53bb1 Update .gitlab-ci.yml testing源仅debug版开启asan 2020-10-30 22:56:20 +08:00
杨威
4942106aab Merge branch 'patch-1' into 'master'
Update travis.sh, ASAN using devtoolset-7

See merge request tango/fw_dns_plug!6
2020-10-14 18:32:51 +08:00
杨威
28cfd57e98 Update travis.sh, ASAN using devtoolset-7 2020-10-14 15:54:09 +08:00
3 changed files with 18 additions and 6 deletions

View File

@@ -67,7 +67,6 @@ develop_build_release:
BUILD_TYPE: RelWithDebInfo
PACKAGE: 1
UPLOAD_RPM: 1
ASAN_OPTION: ADDRESS
TESTING_VERSION_BUILD: 1
PULP3_REPO_NAME: tsg-testing-x86_64.el7
PULP3_DIST_NAME: tsg-testing-x86_64.el7

View File

@@ -37,6 +37,11 @@ if [ -n "${INSTALL_DEPENDENCY_LIBRARY}" ]; then
yum install -y $INSTALL_DEPENDENCY_LIBRARY
source /etc/profile.d/framework.sh
fi
if [ $ASAN_OPTION ];then
source /opt/rh/devtoolset-7/enable
fi
mkdir build || true
cd build

View File

@@ -156,7 +156,7 @@ static char fw_dns_action(struct streaminfo *a_stream, dns_info_t *dns_info, Maa
tmp_buff=NULL;
}
return PROT_STATE_GIVEME;
return PROT_STATE_GIVEME|PROT_STATE_DROPPKT;
}
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)
{
case TSG_METHOD_TYPE_DROP:
state=PROT_STATE_DROPME|PROT_STATE_DROPPKT;
state=PROT_STATE_GIVEME|PROT_STATE_DROPPKT;
break;
case TSG_METHOD_TYPE_REDIRECTION:
if(g_fw_dns_plug_info.mode==0 && dns_info->hdr_info.qr==1) //mirror
@@ -243,8 +243,16 @@ static char fw_dns_action(struct streaminfo *a_stream, dns_info_t *dns_info, Maa
return -1;
}
senddir = MESA_dir_reverse(a_stream->routedir);
if(dns_info->hdr_info.qr==0)
{
senddir = MESA_dir_reverse(a_stream->routedir);
}
else
{
senddir = a_stream->routedir;
}
ret=MESA_inject_pkt(a_stream, (const char *)cheat_pkt_payload, payload_len, (const char *)a_packet, senddir);
if(ret<0)
{
MESA_handle_runtime_log(g_fw_dns_plug_info.logger,
@@ -260,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
{
@@ -276,7 +284,7 @@ static char fw_dns_action(struct streaminfo *a_stream, dns_info_t *dns_info, Maa
dns_info->query_question.qtype,
(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;
default: