From cf99259a02f1cfa227edabcf6f4c24249f78082a Mon Sep 17 00:00:00 2001 From: Darwvin Date: Mon, 12 Oct 2026 10:10:22 +0330 Subject: [PATCH] MT#55283 ice: avoid forcing ICE in a non-ICE answer without an ICE agent Closes #2207 Change-Id: I174419dc418f0d2e0b9b05908d6b17dabf6a3d57 (cherry picked from commit 653650d1cca414c6dc610ca037ea74f550f2e2de) (cherry picked from commit a542784f187902c8cb467e3c94a77a204c0ef702) --- daemon/call.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/daemon/call.c b/daemon/call.c index ec11f6e86..f49920afc 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -1428,6 +1428,14 @@ static void __ice_offer(const sdp_ng_flags *flags, struct call_media *this, if (flags->ice_reject) MEDIA_CLEAR(other, ICE); + // An answer must not introduce ICE where the original offer did not + // advertise it. A locally created ICE agent means we intentionally + // offered ICE on this leg, in which case keep the negotiated state. + // In other cases ignore ICE=force on the answer (see issue #2161). + if (flags->opmode == OP_ANSWER && flags->ice_option == ICE_FORCE && + !MEDIA_ISSET(other, ICE) && !this->ice_agent) + MEDIA_CLEAR(this, ICE); + if (flags->passthrough_on) { ilog(LOG_DEBUG, "enabling passthrough mode"); MEDIA_SET(this, PASSTHRU);