From d63e323bb29ccd002d275d93c64a369a1bf34644 Mon Sep 17 00:00:00 2001 From: Fabrice Bellet Date: Tue, 14 Jun 2016 20:44:55 +0200 Subject: 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 --- agent/conncheck.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; -- cgit v1.2.1