summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabrice Bellet <fabrice@bellet.info>2016-06-14 20:44:55 +0200
committerOlivier CrĂȘte <olivier.crete@collabora.com>2016-06-23 19:35:28 -0400
commitd63e323bb29ccd002d275d93c64a369a1bf34644 (patch)
tree431b4f097776e339bf5aadb224a228820d320b58
parent2ba23c1fc10fa82ebf0f3ae83760a50c68c907d5 (diff)
downloadlibnice-d63e323bb29ccd002d275d93c64a369a1bf34644.tar.gz
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
-rw-r--r--agent/conncheck.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/agent/conncheck.c b/agent/conncheck.c
index 4eac980..7d3ab16 100644
--- a/agent/conncheck.c
+++ b/agent/conncheck.c
@@ -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;