Commit 07e83589 authored by Youness Alaoui's avatar Youness Alaoui

Attempt to work around binding responses with no mapped address to have...

Attempt to work around binding responses with no mapped address to have interop with gtalk2voip.com ICE implementation. Thanks to wahjava for reporting the issue
parent 2dff1e17
......@@ -1912,8 +1912,8 @@ static gboolean priv_map_reply_to_conn_check_request (NiceAgent *agent, Stream *
nice_debug ("Agent %p : stun_bind_process/conncheck for %p res %d "
"(controlling=%d).", agent, p, (int)res, agent->controlling_mode);
if (res == STUN_USAGE_ICE_RETURN_SUCCESS) {
if (res == STUN_USAGE_ICE_RETURN_SUCCESS ||
res == STUN_USAGE_ICE_RETURN_NO_MAPPED_ADDRESS) {
/* case: found a matching connectivity check request */
CandidateCheckPair *ok_pair = NULL;
......@@ -1949,8 +1949,19 @@ static gboolean priv_map_reply_to_conn_check_request (NiceAgent *agent, Stream *
* not match any local candidate, see 7.1.2.2.1
* "Discovering Peer Reflexive Candidates" ICE ID-19) */
ok_pair = priv_process_response_check_for_peer_reflexive(agent, stream, component,
p, sockptr, &sockaddr, local_candidate, remote_candidate);
if (res == STUN_USAGE_ICE_RETURN_NO_MAPPED_ADDRESS) {
/* note: this is same as "adding to VALID LIST" in the spec
text */
p->state = NICE_CHECK_SUCCEEDED;
nice_debug ("Agent %p : Mapped address not found."
" conncheck %p SUCCEEDED.", agent, p);
priv_conn_check_unfreeze_related (agent, stream, p);
} else {
ok_pair = priv_process_response_check_for_peer_reflexive(agent,
stream, component, p, sockptr, &sockaddr,
local_candidate, remote_candidate);
}
if (!ok_pair)
ok_pair = p;
......
......@@ -156,7 +156,7 @@ StunUsageIceReturn stun_usage_ice_conncheck_process (StunMessage *msg,
if (val != STUN_MESSAGE_RETURN_SUCCESS)
{
stun_debug (" No MAPPED-ADDRESS: %d\n", val);
return STUN_USAGE_ICE_RETURN_ERROR;
return STUN_USAGE_ICE_RETURN_NO_MAPPED_ADDRESS;
}
}
......
/*
* This file is part of the Nice GLib ICE library.
*
......@@ -83,6 +84,8 @@ typedef enum {
* the STUN reply
* @STUN_USAGE_ICE_RETURN_INVALID_ADDRESS: The mapped address argument has
* an invalid address family
* @STUN_USAGE_ICE_RETURN_NO_MAPPED_ADDRESS: The response is valid but no
* MAPPED-ADDRESS or XOR-MAPPED-ADDRESS attribute was found
*
* Return value of stun_usage_ice_conncheck_process() and
* stun_usage_ice_conncheck_create_reply() which allows you to see what
......@@ -97,6 +100,7 @@ typedef enum {
STUN_USAGE_ICE_RETURN_INVALID_METHOD,
STUN_USAGE_ICE_RETURN_MEMORY_ERROR,
STUN_USAGE_ICE_RETURN_INVALID_ADDRESS,
STUN_USAGE_ICE_RETURN_NO_MAPPED_ADDRESS,
} StunUsageIceReturn;
......
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