Commit d63e323b authored by Fabrice Bellet's avatar Fabrice Bellet Committed by Olivier Crête

conncheck: fix pair socket assignment

This patch fixes a problem when a new pair having a peer-reflexive new
remote candidate is added while the transport type is udp. In this case
the new pair socket really should be the socket of the local candidate,
and not the remote (for example, the local candidate may be of relayed
type).

Differential Revision: https://phabricator.freedesktop.org/D1122
parent 2ba23c1f
......@@ -1591,7 +1591,11 @@ static CandidateCheckPair *priv_add_new_check_pair (NiceAgent *agent,
pair->component_id = component->id;;
pair->local = local;
pair->remote = remote;
if (remote->type == NICE_CANDIDATE_TYPE_PEER_REFLEXIVE)
/* note: we use the remote sockptr only in the case
* of TCP transport
*/
if (local->transport == NICE_CANDIDATE_TRANSPORT_TCP_PASSIVE &&
remote->type == NICE_CANDIDATE_TYPE_PEER_REFLEXIVE)
pair->sockptr = (NiceSocket *) remote->sockptr;
else
pair->sockptr = (NiceSocket *) local->sockptr;
......
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