diff options
| author | liuxueli <[email protected]> | 2023-03-25 18:28:34 +0800 |
|---|---|---|
| committer | liuxueli <[email protected]> | 2023-03-25 18:28:34 +0800 |
| commit | 3d96907ab7baed0b96eb201231ff392accfe8a8f (patch) | |
| tree | 0f886292ddc3c42c52ccb772d46d3a670e8fed3a | |
| parent | 8f6a3e199a774be6c1865dbef4fc918f76d052e1 (diff) | |
TSG-14413: UDP链接存在C2S变换S2C方向,或者S2C变换C2S方向,命中APP时动作交由TSG MASTER执行(业务层不会命中APP)v5.8.14
| -rw-r--r-- | src/tsg_entry.cpp | 52 |
1 files changed, 28 insertions, 24 deletions
diff --git a/src/tsg_entry.cpp b/src/tsg_entry.cpp index 805beda..ee1bb77 100644 --- a/src/tsg_entry.cpp +++ b/src/tsg_entry.cpp @@ -2163,33 +2163,37 @@ static unsigned char tsg_master_all_entry(const struct streaminfo *a_stream, uns } break; default: - if(all_context->enforce_direction_result==NULL) - { - break; - } - - data_context=(struct master_context *)get_struct_project(a_stream, g_tsg_para.context_project_id); - if(data_context!=NULL && (data_context->proto==PROTO_DNS || data_context->proto==PROTO_QUIC || data_context->proto==PROTO_SIP || data_context->proto==PROTO_RTP || data_context->proto==PROTO_DTLS)) - { - break; - } - - ret=tsg_is_do_deny_action_by_enforce_direction(a_stream, all_context->enforce_direction_result); - if(ret==0) - { - break; - } - - state=tsg_deal_deny_action(a_stream, all_context->enforce_direction_result, (data_context==NULL ? PROTO_UNKONWN : data_context->proto), ACTION_RETURN_TYPE_APP, a_packet); - master_send_log(a_stream, all_context->enforce_direction_result, 1, data_context, thread_seq); - - if(data_context!=NULL) - { - data_context->is_log=1; - } break; } + if(all_context->enforce_direction_result==NULL) + { + return state; + } + + data_context=(struct master_context *)get_struct_project(a_stream, g_tsg_para.context_project_id); + if(data_context!=NULL && + data_context->hited_para.hited_app_id==0 && + (data_context->proto==PROTO_DNS || data_context->proto==PROTO_QUIC || data_context->proto==PROTO_SIP || data_context->proto==PROTO_RTP || data_context->proto==PROTO_DTLS) + ) + { + return state; + } + + ret=tsg_is_do_deny_action_by_enforce_direction(a_stream, all_context->enforce_direction_result); + if(ret==0) + { + return state; + } + + state=tsg_deal_deny_action(a_stream, all_context->enforce_direction_result, (data_context==NULL ? PROTO_UNKONWN : data_context->proto), ACTION_RETURN_TYPE_APP, a_packet); + master_send_log(a_stream, all_context->enforce_direction_result, 1, data_context, thread_seq); + + if(data_context!=NULL) + { + data_context->is_log=1; + } + return state; } |
