agent: ignore externally set peer-reflexive candidates
authorYouness Alaoui <kakaroto@kakaroto.homelinux.net>
Thu, 18 Sep 2014 23:30:08 +0000 (19:30 -0400)
committerOlivier CrĂȘte <olivier.crete@collabora.com>
Thu, 9 Oct 2014 22:24:54 +0000 (18:24 -0400)
All discovered peer-reflexive candidates should be added internally in
conncheck.c and should have the sockptr set. We ignore any prflx
candidates added by an external application because their NULL sockptr
could cause a crash in conn_check_send().

agent/agent.c

index 79651ba..a2fd46d 100644 (file)
@@ -3054,6 +3054,10 @@ static gboolean priv_add_remote_candidate (
   else {
     /* case 2: add a new candidate */
 
+    if (type == NICE_CANDIDATE_TYPE_PEER_REFLEXIVE) {
+      nice_debug("Agent %p : Warning: ignoring externally set peer-reflexive candidate!", agent);
+      return FALSE;
+    }
     candidate = nice_candidate_new (type);
     component->remote_candidates = g_slist_append (component->remote_candidates,
         candidate);