agent: don't change agent role when restarting ice
authorFabrice Bellet <fabrice@bellet.info>
Sun, 21 Feb 2021 10:04:14 +0000 (11:04 +0100)
committerOlivier CrĂȘte <olivier.crete@ocrete.ca>
Fri, 5 Mar 2021 20:15:29 +0000 (20:15 +0000)
Ice restart must not change the role of the agents since RFC8445,
section 9, "ICE Restarts".

agent/agent.c
tests/test-restart.c

index f779d8d..a1dc930 100644 (file)
@@ -5534,14 +5534,6 @@ nice_agent_restart (
 
   agent_lock (agent);
 
-  /* step: regenerate tie-breaker value */
-  priv_generate_tie_breaker (agent);
-
-  /* step: reset controlling mode from the property value */
-  agent->controlling_mode = agent->saved_controlling_mode;
-  nice_debug ("Agent %p : ICE restart, reset role to \"%s\".",
-      agent, agent->controlling_mode ? "controlling" : "controlled");
-
   for (i = agent->streams; i; i = i->next) {
     NiceStream *stream = i->data;
 
index 064cd69..2f1e1b6 100644 (file)
@@ -202,7 +202,6 @@ static int run_restart_test (NiceAgent *lagent, NiceAgent *ragent, NiceAddress *
   NiceCandidate cdes;
   GSList *cands;
   guint ls_id, rs_id;
-  guint64 tie_breaker;
 
   /* XXX: dear compiler, these are for you: */
   (void)baseaddr;
@@ -338,14 +337,7 @@ static int run_restart_test (NiceAgent *lagent, NiceAgent *ragent, NiceAddress *
   g_assert (lagent->controlling_mode == TRUE);
   g_assert (ragent->controlling_mode == FALSE);
   /* step: restart agents, exchange updated credentials */
-  tie_breaker = ragent->tie_breaker;
   nice_agent_restart (ragent);
-  g_assert (tie_breaker != ragent->tie_breaker);
-  /* This role switch of ragent should be done now, and both agents
-   * have now the same role, which should generate a role conflict
-   * resolution situation */
-  g_assert (lagent->controlling_mode == TRUE);
-  g_assert (ragent->controlling_mode == TRUE);
   nice_agent_restart (lagent);
   {
       gchar *ufrag = NULL, *password = NULL;