summaryrefslogtreecommitdiff
path: root/common/src/tfe_packet_io.cpp
diff options
context:
space:
mode:
authorwangmenglan <[email protected]>2023-06-13 20:23:57 +0800
committerwangmenglan <[email protected]>2023-06-13 20:23:57 +0800
commit30f0f83566fefe9a30d561f78f50d8cc60167204 (patch)
treec7c6cbd1aa717e3eaf1585b8a02e58ff46f4bc29 /common/src/tfe_packet_io.cpp
parent5ad6ef771daf843f931cb6b6acde3f569813407b (diff)
TSG-15510 修复No Intercept没有发送metricsv4.8.27-20230613
Diffstat (limited to 'common/src/tfe_packet_io.cpp')
-rw-r--r--common/src/tfe_packet_io.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/common/src/tfe_packet_io.cpp b/common/src/tfe_packet_io.cpp
index 6d40c9f..1b9e848 100644
--- a/common/src/tfe_packet_io.cpp
+++ b/common/src/tfe_packet_io.cpp
@@ -1225,14 +1225,13 @@ static int handle_session_opening(struct metadata *meta, struct ctrl_pkt_parser
}
raw_packet_parser_get_most_inner_tuple4(&raw_parser, &inner_tuple4, logger);
+ ret = intercept_policy_enforce(thread->ref_proxy->int_ply_enforcer, parser->cmsg);
+ if (ret != 0) {
+ is_passthrough = 1;
+ set_passthrough_reason(parser->cmsg, reason_invalid_intercept_param);
+ goto passthrough;
+ }
if (parser->intercpet_data == 0) {
- ret = intercept_policy_enforce(thread->ref_proxy->int_ply_enforcer, parser->cmsg);
- if (ret != 0) {
- is_passthrough = 1;
- set_passthrough_reason(parser->cmsg, reason_invalid_intercept_param);
- goto passthrough;
- }
-
tfe_cmsg_get_value(parser->cmsg, TFE_CMSG_HIT_NO_INTERCEPT, (unsigned char *)&hit_no_intercept, sizeof(hit_no_intercept), &out_size);
if (hit_no_intercept == 1) {
is_passthrough = 1;
@@ -1423,7 +1422,7 @@ static int handle_session_closing(struct metadata *meta, struct ctrl_pkt_parser
{
struct session_ctx *s_ctx = (struct session_ctx *)node->val_data;
TFE_LOG_INFO(logger, "%s: session %lu closing", LOG_TAG_PKTIO, s_ctx->session_id);
- tfe_set_intercept_metric(acceptor_ctx->metric, s_ctx->cmsg, 1, s_ctx->c2s_info.rx.n_pkts, s_ctx->c2s_info.rx.n_bytes, s_ctx->s2c_info.rx.n_pkts, s_ctx->s2c_info.rx.n_bytes, thread_seq);
+ tfe_set_intercept_metric(acceptor_ctx->metric, s_ctx->cmsg, 1, s_ctx->c2s_info.rx.n_pkts, s_ctx->c2s_info.rx.n_bytes, s_ctx->s2c_info.rx.n_pkts, s_ctx->s2c_info.rx.n_bytes, thread_seq, s_ctx->c2s_info.is_e2i_dir);
session_table_delete_by_id(thread->session_table, meta->session_id);
ATOMIC_DEC(&(packet_io_fs->session_num));
return 0;