TSG-8025、TSG-8026: 修复block、alert动作的应答页面浏览器未展示的问题
This commit is contained in:
@@ -222,13 +222,26 @@ static int get_response_pages(struct Maat_rule_t *p_result, struct compile_user_
|
||||
return payload_len;
|
||||
}
|
||||
|
||||
static int set_tcp_flags(char *packet, int ip_tcp_hdr_len)
|
||||
static int set_tcp_rst_flags(char *packet, int ip_tcp_hdr_len)
|
||||
{
|
||||
struct tcphdr *tcp=(struct tcphdr *)(packet+(ip_tcp_hdr_len-20)); // tcp header=20 bytes
|
||||
|
||||
tcp->rst=1;
|
||||
tcp->psh=0;
|
||||
tcp->ack=1;
|
||||
tcp->psh=0;
|
||||
tcp->fin=0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_tcp_fin_flags(char *packet, int ip_tcp_hdr_len)
|
||||
{
|
||||
struct tcphdr *tcp=(struct tcphdr *)(packet+(ip_tcp_hdr_len-20)); // tcp header=20 bytes
|
||||
|
||||
tcp->fin=1;
|
||||
tcp->ack=1;
|
||||
tcp->psh=0;
|
||||
tcp->rst=0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -428,7 +441,13 @@ static int http_build_response_packet(const struct streaminfo *a_stream, struct
|
||||
payload=NULL;
|
||||
}
|
||||
|
||||
set_tcp_flags(message, ip_tcp_hdr_len);
|
||||
set_tcp_fin_flags(message, ip_tcp_hdr_len);
|
||||
http_send_reponse_packet(a_stream, message, 0, v4_or_v6, ip_tcp_hdr_len, 0); //fin
|
||||
|
||||
reverse_ip_tcp_header(message, ip_tcp_hdr_len, v4_or_v6);
|
||||
http_send_reponse_packet(a_stream, message, 0, v4_or_v6, ip_tcp_hdr_len, 0); //fin
|
||||
|
||||
set_tcp_rst_flags(message, ip_tcp_hdr_len);
|
||||
http_send_reponse_packet(a_stream, message, 0, v4_or_v6, ip_tcp_hdr_len, 0); //rst
|
||||
|
||||
reverse_ip_tcp_header(message, ip_tcp_hdr_len, v4_or_v6);
|
||||
|
||||
@@ -1818,7 +1818,7 @@ extern "C" int TSG_MASTER_INIT()
|
||||
MESA_load_profile_int_def(tsg_conffile, "RESET", "SEED2", &g_tsg_para.reset.seed2, 13);
|
||||
MESA_load_profile_int_def(tsg_conffile, "RESET", "FLAGS", &g_tsg_para.reset.th_flags, 0x14);
|
||||
MESA_load_profile_int_def(tsg_conffile, "RESET", "DIR", &g_tsg_para.reset.dir, DIR_DOUBLE);
|
||||
MESA_load_profile_int_def(tsg_conffile, "RESET", "REMEDY", &g_tsg_para.reset.remedy, 0);
|
||||
MESA_load_profile_int_def(tsg_conffile, "RESET", "REMEDY", &g_tsg_para.reset.remedy, 1);
|
||||
|
||||
MESA_load_profile_int_def(tsg_conffile, "SYSTEM","DEFAULT_POLICY_ID", &g_tsg_para.default_compile_id, 0);
|
||||
MESA_load_profile_int_def(tsg_conffile, "SYSTEM","DEFAULT_POLICY_SWITCH", &g_tsg_para.default_compile_switch, 0);
|
||||
|
||||
Reference in New Issue
Block a user