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.
/* step: check whether the candidate already exists */
candidate = component_find_remote_candidate(component, addr, transport);
- if (candidate) {
+ if (candidate && candidate->type == type) {
if (nice_debug_is_enabled ()) {
gchar tmpbuf[INET6_ADDRSTRLEN];
nice_address_to_string (addr, tmpbuf);