Commit 93862c1e authored by Youness Alaoui's avatar Youness Alaoui

Do not update a remote candidate's type

When adding a remote candidate, if it's the same ip:port, we should
also check its type, otherwise it's a new candidate. We can't allow
a candidate type to be updated. This caused issues to ikonst_ on IRC
where for some reason a host candidate appeared as both host and prflx
and the update caused a remote host candidate to be updated to prflx
causing a crash when the sockptr was being accessed.
parent 7b7d2d98
...@@ -3041,7 +3041,7 @@ static gboolean priv_add_remote_candidate ( ...@@ -3041,7 +3041,7 @@ static gboolean priv_add_remote_candidate (
/* step: check whether the candidate already exists */ /* step: check whether the candidate already exists */
candidate = component_find_remote_candidate(component, addr, transport); candidate = component_find_remote_candidate(component, addr, transport);
if (candidate) { if (candidate && candidate->type == type) {
if (nice_debug_is_enabled ()) { if (nice_debug_is_enabled ()) {
gchar tmpbuf[INET6_ADDRSTRLEN]; gchar tmpbuf[INET6_ADDRSTRLEN];
nice_address_to_string (addr, tmpbuf); nice_address_to_string (addr, tmpbuf);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment