discovery: redundant candidates should have the same transport
authorFabrice Bellet <fabrice@bellet.info>
Fri, 8 May 2020 20:44:35 +0000 (22:44 +0200)
committerOlivier CrĂȘte <olivier.crete@ocrete.ca>
Mon, 14 Dec 2020 19:13:21 +0000 (19:13 +0000)
When dropping redundant server-reflexive and relay candidates, they
should of course have the same transport too.

agent/discovery.c

index 823a50f..9a0e7fd 100644 (file)
@@ -430,6 +430,7 @@ static gboolean priv_add_local_candidate_pruned (NiceAgent *agent, guint stream_
 
     if (c->type == NICE_CANDIDATE_TYPE_RELAYED &&
         candidate->type == NICE_CANDIDATE_TYPE_RELAYED &&
+        c->transport == candidate->transport &&
         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);
@@ -438,6 +439,7 @@ static gboolean priv_add_local_candidate_pruned (NiceAgent *agent, guint stream_
 
     if (c->type == NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE &&
         candidate->type == NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE &&
+        c->transport == candidate->transport &&
         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);