From d1801d4f20d09eb57be22b8f59df7fb3befb9aa6 Mon Sep 17 00:00:00 2001 From: liuxueli Date: Tue, 22 Aug 2023 18:41:42 +0800 Subject: [PATCH] =?UTF-8?q?MESA=5Fset=5Fstream=5Fopt=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E4=B8=A2=E5=BC=83=E5=BD=93=E5=89=8D=E5=8C=85=EF=BC=8C=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E6=9C=AA=E7=BD=AE1=E5=AF=BC=E8=87=B4=E6=9C=AA?= =?UTF-8?q?=E4=B8=A2=E5=BC=83=E6=88=90=E5=8A=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tsg_dns.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tsg_dns.cpp b/src/tsg_dns.cpp index 3ab9f91..a010f07 100644 --- a/src/tsg_dns.cpp +++ b/src/tsg_dns.cpp @@ -218,7 +218,6 @@ 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}; @@ -252,6 +251,7 @@ 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) { + int opt_value=1; MESA_set_stream_opt(a_stream, MSO_DROP_CURRENT_PKT, (void *)&opt_value, sizeof(opt_value)); return STATE_GIVEME; } @@ -269,6 +269,7 @@ 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); + int opt_value=1; MESA_set_stream_opt(a_stream, MSO_DROP_CURRENT_PKT, (void *)&opt_value, sizeof(opt_value)); return STATE_GIVEME;