discovery: Make it less likely that a locally assigned remote foundation clashes...
authorOlivier Crête <olivier.crete@collabora.com>
Sat, 17 May 2014 05:49:46 +0000 (01:49 -0400)
committerOlivier Crête <olivier.crete@collabora.com>
Sat, 17 May 2014 05:49:46 +0000 (01:49 -0400)
agent/discovery.c

index 1a78e9c..f457edf 100644 (file)
@@ -292,7 +292,8 @@ static guint priv_highest_remote_foundation (Component *component)
   for (highest = 1;; highest++) {
     gboolean taken = FALSE;
 
-    g_snprintf (foundation, NICE_CANDIDATE_MAX_FOUNDATION, "%u", highest);
+    g_snprintf (foundation, NICE_CANDIDATE_MAX_FOUNDATION, "remote-%u",
+        highest);
     for (i = component->remote_candidates; i; i = i->next) {
       NiceCandidate *cand = i->data;
       if (strncmp (foundation, cand->foundation,
@@ -422,7 +423,7 @@ static void priv_assign_remote_foundation (NiceAgent *agent, NiceCandidate *cand
   if (component) {
     next_remote_id = priv_highest_remote_foundation (component);
     g_snprintf (candidate->foundation, NICE_CANDIDATE_MAX_FOUNDATION,
-        "%u", next_remote_id);
+        "remote-%u", next_remote_id);
   }
 }