agent: reset remote credentials when restarting ice
authorFabrice Bellet <fabrice@bellet.info>
Sun, 21 Feb 2021 10:10:12 +0000 (11:10 +0100)
committerOlivier CrĂȘte <olivier.crete@ocrete.ca>
Fri, 5 Mar 2021 20:15:29 +0000 (20:15 +0000)
The remote credentials recorded in the streams should be reset,
in the case the restarted conncheck begins with new remote candidates
*before* the updated remote credentials are received.

agent/stream.c

index 08a7dad..ed40b08 100644 (file)
@@ -117,6 +117,13 @@ nice_stream_initialize_credentials (NiceStream *stream, NiceRNG *rng)
    *       '"ice-ufrag" and "ice-pwd" Attributes', ID-19) */
   nice_rng_generate_bytes_print (rng, NICE_STREAM_DEF_UFRAG - 1, stream->local_ufrag);
   nice_rng_generate_bytes_print (rng, NICE_STREAM_DEF_PWD - 1, stream->local_password);
+
+  /* reset remote credentials, because we cannot assume that we'll
+   * receive new remote credentials from the SDP before the conncheck
+   * restarts with new inbound STUN requests
+   */
+  stream->remote_ufrag[0] = 0;
+  stream->remote_password[0] = 0;
 }
 
 /*