Commit 8efaf78c authored by Fabrice Bellet's avatar Fabrice Bellet Committed by Olivier Crête
Browse files

conncheck: another rare case of local tcp active candidate matching

An inbound stun request may come on a tcp pair, whose tcp-active socket
has just been created and connected (the local candidate port is zero),
but has not caused the creation of a discovered peer-reflexive local
candidate (with a non-zero port). This inbound request is stored in an
early icheck structure to be replayed later. When being processed after
remote creds have been received, we have to find which local candidate
it belongs to, by matching with the address only, without the port.
parent 6f0710c4
Pipeline #143663 failed with stages
in 16 minutes and 15 seconds
...@@ -2064,6 +2064,24 @@ conn_check_remote_candidates_set(NiceAgent *agent, NiceStream *stream, ...@@ -2064,6 +2064,24 @@ conn_check_remote_candidates_set(NiceAgent *agent, NiceStream *stream,
} }
} }
if (lcand == NULL) {
for (j = component->local_candidates; j; j = j->next) {
NiceCandidate *cand = j->data;
NiceAddress *addr = &cand->base_addr;
/* tcp-active (not peer-reflexive discovered) local candidate, where
* socket is the tcp connect related socket */
if (nice_address_equal_no_port (&icheck->local_socket->addr, addr) &&
nice_address_get_port (&cand->addr) == 0 &&
cand->transport == NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE &&
local_candidate_and_socket_compatible (agent, cand,
icheck->local_socket)) {
lcand = cand;
break;
}
}
}
g_assert (lcand != NULL); g_assert (lcand != NULL);
for (j = component->remote_candidates; j; j = j->next) { for (j = component->remote_candidates; j; j = j->next) {
......
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