From 9ed6aacd686eb70aba6ce8f0e76ea9fdc10ab4d2 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Tue, 23 May 2023 01:19:55 -0400 Subject: [PATCH] MT#55283 avoid erroneous endpoint learning Perform endpoint address check before doing ingress SSRC handling. We don't want to act on an apparent SSRC change if the endpoint address doesn't match and the packet should have been ignored. Closes #1655 Change-Id: I251e23b1583b1916c7c4904cf40d3b37b3533117 --- daemon/media_socket.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/daemon/media_socket.c b/daemon/media_socket.c index 52d5d68cb..1b8778031 100644 --- a/daemon/media_socket.c +++ b/daemon/media_socket.c @@ -2741,12 +2741,15 @@ static int stream_packet(struct packet_handler_ctx *phc) { } #endif - if (rtpe_config.active_switchover && IS_FOREIGN_CALL(phc->mp.call)) - call_make_own_foreign(phc->mp.call, false); - // this sets rtcp, in_srtp, and sinks media_packet_rtcp_demux(phc); + if (media_packet_address_check(phc)) + goto drop; + + if (rtpe_config.active_switchover && IS_FOREIGN_CALL(phc->mp.call)) + call_make_own_foreign(phc->mp.call, false); + bool is_blackhole = MEDIA_ISSET(phc->mp.media, BLACKHOLE); if (!is_blackhole) is_blackhole = !phc->rtcp && !MEDIA_ISSET(phc->mp.media, RECV); @@ -2819,9 +2822,6 @@ static int stream_packet(struct packet_handler_ctx *phc) { if (!PS_ISSET(phc->mp.stream, KERNELIZED) || rtpe_now.tv_sec > phc->mp.stream->kernel_time + 1) count_stream_stats_userspace(phc->mp.stream); - if (media_packet_address_check(phc)) - goto drop; - ///////////////// EGRESS HANDLING str orig_raw = STR_NULL;