Commit 00dfcc6a authored by Fabrice Bellet's avatar Fabrice Bellet Committed by Olivier Crête

socket: ping the stun server address on the right socket

Verify the compatibility of the socket domain with the stun server
IP address, before sending a request.
Reviewed-by: Olivier Crête's avatarOlivier Crête <olivier.crete@collabora.com>
Differential Revision: https://phabricator.freedesktop.org/D1894
parent 05f1e302
......@@ -3062,11 +3062,13 @@ nice_agent_gather_candidates (
if (nice_address_set_from_string (&stun_server, agent->stun_server_ip)) {
nice_address_set_port (&stun_server, agent->stun_server_port);
priv_add_new_candidate_discovery_stun (agent,
host_candidate->sockptr,
stun_server,
stream,
cid);
if (nice_address_ip_version (&host_candidate->addr) ==
nice_address_ip_version (&stun_server))
priv_add_new_candidate_discovery_stun (agent,
host_candidate->sockptr,
stun_server,
stream,
cid);
}
}
......
......@@ -1459,7 +1459,9 @@ static gboolean priv_conn_keepalive_tick_unlocked (NiceAgent *agent)
for (k = component->local_candidates; k; k = k->next) {
NiceCandidate *candidate = (NiceCandidate *) k->data;
if (candidate->type == NICE_CANDIDATE_TYPE_HOST &&
candidate->transport == NICE_CANDIDATE_TRANSPORT_UDP) {
candidate->transport == NICE_CANDIDATE_TRANSPORT_UDP &&
nice_address_ip_version (&candidate->addr) ==
nice_address_ip_version (&stun_server)) {
/* send the conncheck */
nice_debug ("Agent %p : resending STUN on %s to keep the "
"candidate alive.", agent, candidate->foundation);
......
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