TT#14008 ignore cross-family endpoint changes for ICE

Change-Id: I0e4a54b9255395ffd792665ce558a7f270cbb5d2
(cherry picked from commit e3de05e77d)
pull/1457/head
Richard Fuchs 4 years ago
parent 429e3dafb9
commit 85fa5a8aa3

@ -1140,20 +1140,29 @@ static void __fill_stream(struct packet_stream *ps, const struct endpoint *epp,
&& !ice_ufrag_cmp(media->ice_agent, &sp->ice_ufrag)) && !ice_ufrag_cmp(media->ice_agent, &sp->ice_ufrag))
return; return;
if (ps->selected_sfd && ep.address.family != ps->selected_sfd->socket.family) { if (!MEDIA_ISSET(media, ICE)) {
if (ep.address.family && !is_trickle_ice_address(&ep)) if (PS_ISSET(ps, FILLED) && ps->selected_sfd
ilog(LOG_WARN, "Ignoring updated remote endpoint %s%s%s as the local " && ep.address.family != ps->selected_sfd->socket.family)
"socket is %s", FMT_M(endpoint_print_buf(&ep)), {
ps->selected_sfd->socket.family->name); if (ep.address.family && !is_trickle_ice_address(&ep))
return; ilog(LOG_WARN, "Ignoring updated remote endpoint %s%s%s as the local "
} "socket is %s", FMT_M(endpoint_print_buf(&ep)),
ps->selected_sfd->socket.family->name);
return;
}
ps->endpoint = ep; ps->endpoint = ep;
if (PS_ISSET(ps, FILLED) && !MEDIA_ISSET(media, DTLS)) { if (PS_ISSET(ps, FILLED) && !MEDIA_ISSET(media, DTLS)) {
/* we reset crypto params whenever the endpoint changes */ /* we reset crypto params whenever the endpoint changes */
call_stream_crypto_reset(ps); call_stream_crypto_reset(ps);
dtls_shutdown(ps); dtls_shutdown(ps);
}
}
else {
// ICE
if (!PS_ISSET(ps, FILLED))
ps->endpoint = ep;
} }
/* endpont-learning setup */ /* endpont-learning setup */
@ -2686,13 +2695,16 @@ static int __media_init_from_flags(struct call_media *other_media, struct call_m
call_str_cpy(call, &media->format_str, &sp->format_str); call_str_cpy(call, &media->format_str, &sp->format_str);
} }
// deduct address family from stream parameters received /* deduct address family from stream parameters received */
other_media->desired_family = sp->rtp_endpoint.address.family; if (!other_media->desired_family || !MEDIA_ISSET(other_media, ICE))
// for outgoing SDP, use "direction"/DF or default to what was offered other_media->desired_family = sp->rtp_endpoint.address.family;
if (media && !media->desired_family) /* for outgoing SDP, use "direction"/DF or default to what was offered */
media->desired_family = other_media->desired_family; if (media && (!media->desired_family || !MEDIA_ISSET(media, ICE))) {
if (media && sp->desired_family) if (!media->desired_family)
media->desired_family = sp->desired_family; media->desired_family = other_media->desired_family;
if (sp->desired_family)
media->desired_family = sp->desired_family;
}
return 0; return 0;
} }

Loading…
Cancel
Save