Commit fcd6bc86 authored by Fabrice Bellet's avatar Fabrice Bellet Committed by Olivier Crête

conncheck: discard new pair creation when priority is too low

It is possible to ignore the creation of a new pair whose priority is
lower than the priority of the selected pair, ie the nominated pair with
the highest priority. Such pair would be discarded by a call to
prune_pending_checks(), and if checked, there state would break the
assumption that all pairs with lower priority than the nominated pair
are not retransmitted.
parent 93b5d3cb
......@@ -2450,10 +2450,26 @@ static CandidateCheckPair *priv_add_new_check_pair (NiceAgent *agent,
NiceStream *stream;
CandidateCheckPair *pair;
guint64 priority;
g_assert (local != NULL);
g_assert (remote != NULL);
priority = agent_candidate_pair_priority (agent, local, remote);
if (component->selected_pair.priority &&
priority < component->selected_pair.priority) {
nice_candidate_pair_priority_to_string (priority, prio1);
nice_candidate_pair_priority_to_string (component->selected_pair.priority,
nice_debug ("Agent %p : do not create a pair that would have a priority "
"%s lower than selected pair priority %s.", agent, prio1, prio2);
return NULL;
stream = agent_find_stream (agent, stream_id);
pair = g_slice_new0 (CandidateCheckPair);
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