Commit 3a58ba61 authored by Fabrice Bellet's avatar Fabrice Bellet

conncheck: peer reflexive candidates are not paired

This patch makes the code compliant with ICE RFC, 7.2.1.3 "Learning
Peer Reflexive Candidates" and 7.1.3.2.1 "Discovering Peer Reflexive
Candidates", where discovered candidates do not cause the creation
of new pairs to be checked.

Differential Revision: https://phabricator.freedesktop.org/D805
parent 7a2c1edf
......@@ -1787,6 +1787,15 @@ int conn_check_add_for_candidate (NiceAgent *agent, guint stream_id, NiceCompone
g_assert (remote != NULL);
/* note: according to 7.2.1.3, "Learning Peer Reflexive Candidates",
* the agent does not pair this candidate with any local candidates.
*/
if (agent->compatibility == NICE_COMPATIBILITY_RFC5245 &&
remote->type == NICE_CANDIDATE_TYPE_PEER_REFLEXIVE)
{
return added;
}
for (i = component->local_candidates; i ; i = i->next) {
NiceCandidate *local = i->data;
......@@ -1821,6 +1830,18 @@ int conn_check_add_for_local_candidate (NiceAgent *agent, guint stream_id, NiceC
g_assert (local != NULL);
/*
* note: according to 7.1.3.2.1 "Discovering Peer Reflexive
* Candidates", the peer reflexive candidate is not paired
* with other remote candidates
*/
if (agent->compatibility == NICE_COMPATIBILITY_RFC5245 &&
local->type == NICE_CANDIDATE_TYPE_PEER_REFLEXIVE)
{
return added;
}
for (i = component->remote_candidates; i ; i = i->next) {
NiceCandidate *remote = i->data;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment