conncheck: honor the retransmit flag in case of role conflict
authorFabrice Bellet <fabrice@bellet.info>
Mon, 13 Apr 2020 15:46:13 +0000 (17:46 +0200)
committerOlivier CrĂȘte <olivier.crete@collabora.com>
Wed, 6 May 2020 01:12:20 +0000 (21:12 -0400)
This other rare situation happens when a role conflict is detected by an
stun reply message, on a component that already has a nominated pair
with a higher priority. In that case, the retransmit flag should be
honored, and the pair with "role conflict" should not be retransmitted.

agent/conncheck.c

index 41d8c92..324c373 100644 (file)
@@ -3784,6 +3784,12 @@ static gboolean priv_map_reply_to_conn_check_request (NiceAgent *agent, NiceStre
         uint64_t tie;
         gboolean controlled_mode;
 
+        if (!p->retransmit) {
+          nice_debug ("Agent %p : Role conflict with pair %p, not restarting",
+              agent, p);
+          return TRUE;
+        }
+
        /* case: role conflict error, need to restart with new role */
        nice_debug ("Agent %p : Role conflict with pair %p, restarting",
             agent, p);