From 1585ca7aafbf7b8259fe3988ce80bae7b2cdbb41 Mon Sep 17 00:00:00 2001 From: Jakub Karolczyk Date: Mon, 15 Sep 2025 16:59:30 +0100 Subject: [PATCH] [core] Fix - add missing ice_mutex to protect dtls --- src/switch_rtp.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/switch_rtp.c b/src/switch_rtp.c index fca4d53227..20fba2720a 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -1,6 +1,6 @@ /* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2014, Anthony Minessale II + * Copyright (C) 2005-2025, Anthony Minessale II * * Version: MPL 1.1 * @@ -5904,10 +5904,15 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t rtp_session->has_rtp = 0; rtp_session->has_ice = 0; rtp_session->has_rtcp = 0; + + switch_mutex_lock(rtp_session->ice_mutex); if (rtp_session->dtls) { rtp_session->dtls->bytes = 0; rtp_session->dtls->data = NULL; } + + switch_mutex_unlock(rtp_session->ice_mutex); + memset(&rtp_session->last_rtp_hdr, 0, sizeof(rtp_session->last_rtp_hdr)); if (poll_status == SWITCH_STATUS_SUCCESS) { @@ -5927,10 +5932,14 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t } if ((*b >= 20) && (*b <= 64)) { + switch_mutex_lock(rtp_session->ice_mutex); if (rtp_session->dtls) { rtp_session->dtls->bytes = *bytes; rtp_session->dtls->data = (void *) &rtp_session->recv_msg; } + + switch_mutex_unlock(rtp_session->ice_mutex); + rtp_session->has_ice = 0; rtp_session->has_rtp = 0; rtp_session->has_rtcp = 0; -- 2.47.3