Commit a85b17c7 authored by Fabrice Bellet's avatar Fabrice Bellet Committed by Olivier Crête
Browse files

discovery: use a single server reflexive and relay local candidate

The rationale with this patch is that an agent running on a multihomed
host have no gain to store multiple identical server reflexive and relay
local candidates (those obtained by a stun bind request sent from each
local interface). The stun requests that use the same default route are
all expected to provide the same answer.

This patch should keep intact the ICE conncheck versatility, and
drastically improve the conncheck time to completion, as the number of
checked pairs is reduced.
parent 3144e58c
......@@ -423,7 +423,24 @@ static gboolean priv_add_local_candidate_pruned (NiceAgent *agent, guint stream_
if (nice_address_equal (&c->base_addr, &candidate->base_addr) &&
nice_address_equal (&c->addr, &candidate->addr) &&
c->transport == candidate->transport) {
nice_debug ("Candidate %p (component-id %u) redundant, ignoring.", candidate, component->id);
nice_debug ("Agent %p : s%d/c%d : cand %p redundant, ignoring.",
agent, stream_id, component->id, candidate);
return FALSE;
}
if (c->type == NICE_CANDIDATE_TYPE_RELAYED &&
candidate->type == NICE_CANDIDATE_TYPE_RELAYED &&
nice_address_equal_no_port (&c->addr, &candidate->addr)) {
nice_debug ("Agent %p : s%d/c%d : relay cand %p redundant, ignoring.",
agent, stream_id, component->id, candidate);
return FALSE;
}
if (c->type == NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE &&
candidate->type == NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE &&
nice_address_equal_no_port (&c->addr, &candidate->addr)) {
nice_debug ("Agent %p : s%d/c%d : srflx cand %p redundant, ignoring.",
agent, stream_id, component->id, candidate);
return FALSE;
}
}
......
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