Commit e7b04942 authored by Fabrice Bellet's avatar Fabrice Bellet Committed by Olivier Crête
Browse files

conncheck: properly select tcp-active discovered candidate

Some tcp-active discovered peer-reflexive local candidates may only be
recognised by their local socket, if they have the same address and same
port. It may happen when a nat generates an identical mapping from two
different base local candidates.
parent ade16ee9
......@@ -1971,9 +1971,14 @@ local_candidate_and_socket_compatible (NiceAgent *agent,
g_assert (socket);
g_assert (lcand);
if (nice_socket_has_compatible_transport (socket, &transport))
if (nice_socket_has_compatible_transport (socket, &transport)) {
ret = (lcand->transport == transport);
else if (socket->type == NICE_SOCKET_TYPE_UDP_TURN)
/* tcp-active discovered peer-reflexive local candidate, where
* socket is the tcp connect related socket */
if (ret && transport == NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE &&
nice_address_get_port (&lcand->addr) > 0)
ret = (lcand->sockptr == socket);
} else if (socket->type == NICE_SOCKET_TYPE_UDP_TURN)
/* Socket of type udp-turn will match a unique local candidate
* by its sockptr value. An an udp-turn socket doesn't carry enough
* information when base socket is udp-turn-over-tcp to disambiguate
......
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