bugfix:修复cmsg被释放后,继续使用导致core

This commit is contained in:
wangmenglan
2023-10-10 19:42:12 +08:00
parent 2d2c72661a
commit 6b1aae23bb

View File

@@ -1314,6 +1314,7 @@ static int handle_session_opening(struct metadata *meta, struct ctrl_pkt_parser
} }
} }
tfe_cmsg_dup(parser->cmsg);
if (tfe_proxy_fds_accept(thread->ref_proxy, fd_downstream, fd_upstream, fd_fake_c, fd_fake_s, parser->cmsg) < 0) if (tfe_proxy_fds_accept(thread->ref_proxy, fd_downstream, fd_upstream, fd_fake_c, fd_fake_s, parser->cmsg) < 0)
{ {
TFE_LOG_ERROR(logger, "%s: session %lu Failed at tfe_proxy_fds_accept()", LOG_TAG_PKTIO, meta->session_id); TFE_LOG_ERROR(logger, "%s: session %lu Failed at tfe_proxy_fds_accept()", LOG_TAG_PKTIO, meta->session_id);
@@ -1391,7 +1392,6 @@ passthrough:
session_table_insert(thread->session_table, s_ctx->session_id, &(s_ctx->c2s_info.tuple4), s_ctx, session_value_free_cb); session_table_insert(thread->session_table, s_ctx->session_id, &(s_ctx->c2s_info.tuple4), s_ctx, session_value_free_cb);
ATOMIC_INC(&(packet_io_fs->session_num)); ATOMIC_INC(&(packet_io_fs->session_num));
tfe_cmsg_dup(parser->cmsg);
if (parser->seq_header) if (parser->seq_header)
FREE(&parser->seq_header); FREE(&parser->seq_header);
if (parser->ack_header) if (parser->ack_header)