MT#66271 discard ICE agent when peer drops ice or `ICE=remove`

Both mean that the ice towards the offerer gets rejected.

When a certain peer who previously offered ice, sends SDP without ice
(e.g. T.38 re-invite), or the ice was requested to be removed
(when processing answer) with `ICE=remove` then the ice agent is left alive
with its learned ufrag, candidates and succeeded pairs.

The stream endpoint is then taken from that SDP (non-ice path).

If this peer later offers ice again with the same credentials (e.g.
falling back to audio after an error response like 488 for that T.38),
then this stale agent is reused:
`__fill_stream()` ignores the new endpoint because the ice data
considered as unchanged, and then the `ice_update()` drops these candidates as duplicates.
Therefore no connectivity checks run and then the endpoint stays at the old non-iced address.

Media gets bound to the wrong port.

Shutdown the ice agent whenever the peer's own sdp no longer carries ice,
or we get the `ICE=remove`.
Then the offered ice again later starts from scratch.

Change-Id: I5ff3b6454262099022bf4f61c84b978835130dcc
(cherry picked from commit 39fd49b6c4)
mr13.5
Donat Zenichev 1 month ago
parent f06d163fc4
commit a524d5e8ca

@ -2250,8 +2250,12 @@ static void __ice_start(struct call_media *media) {
ice_shutdown(&media->ice_agent);
return;
}
if (!MEDIA_ISSET(media, ICE)) /* don't init new ICE agent but leave it running if there is one */
if (!MEDIA_ISSET(media, ICE)) {
/* not doing ICE anymore with this peer,
* discard this agent, so that ice offered again later starts afresh */
ice_shutdown(&media->ice_agent);
return;
}
ice_agent_init(&media->ice_agent, media);
}

Loading…
Cancel
Save