summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMadaro Livio <livio.madaro@telecomitalia.it>2012-02-08 22:03:14 -0500
committerYouness Alaoui <youness.alaoui@collabora.co.uk>2012-02-08 22:03:14 -0500
commitc38c33262687c3df0c57d15f885956ea362d641d (patch)
tree081a33f641ab5c0047d30e6ea9ce6663409bb245
parente4eb5659252b699c4188ee8fc5714ea0aacafbc9 (diff)
The server reflexive candidate gathered from the turn server is
not valid if the socket is reliable (TCP). The patch does not add the candidate to the local candidate list if the socket is reliable.
-rw-r--r--agent/conncheck.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/agent/conncheck.c b/agent/conncheck.c
index ce77859..3f46cc5 100644
--- a/agent/conncheck.c
+++ b/agent/conncheck.c
@@ -2317,8 +2317,10 @@ static gboolean priv_map_reply_to_relay_request (NiceAgent *agent, StunMessage *
NiceAddress niceaddr;
NiceCandidate *relay_cand;
- /* We also received our mapped address */
- if (res == STUN_USAGE_TURN_RETURN_MAPPED_SUCCESS) {
+ /* Server reflexive candidates are only valid for UDP sockets */
+ if (res == STUN_USAGE_TURN_RETURN_MAPPED_SUCCESS &&
+ !nice_socket_is_reliable (d->nicesock)) {
+ /* We also received our mapped address */
nice_address_set_from_sockaddr (&niceaddr,
(struct sockaddr *) &sockaddr);