Commit 02a352c9 authored by Youness Alaoui's avatar Youness Alaoui

Make sure the address of the remote candidate is valid when we add it

parent 2796330b
...@@ -2023,7 +2023,7 @@ static gboolean priv_add_remote_candidate ( ...@@ -2023,7 +2023,7 @@ static gboolean priv_add_remote_candidate (
GSList *modified_list = g_slist_append (component->remote_candidates, candidate); GSList *modified_list = g_slist_append (component->remote_candidates, candidate);
if (modified_list) { if (modified_list) {
component->remote_candidates = modified_list; component->remote_candidates = modified_list;
candidate->stream_id = stream_id; candidate->stream_id = stream_id;
candidate->component_id = component_id; candidate->component_id = component_id;
...@@ -2165,22 +2165,25 @@ nice_agent_set_remote_candidates (NiceAgent *agent, guint stream_id, guint compo ...@@ -2165,22 +2165,25 @@ nice_agent_set_remote_candidates (NiceAgent *agent, guint stream_id, guint compo
for (i = candidates; i && added >= 0; i = i->next) { for (i = candidates; i && added >= 0; i = i->next) {
NiceCandidate *d = (NiceCandidate*) i->data; NiceCandidate *d = (NiceCandidate*) i->data;
gboolean res =
priv_add_remote_candidate (agent, if (nice_address_is_valid (&d->addr) == TRUE) {
stream_id, gboolean res =
component_id, priv_add_remote_candidate (agent,
d->type, stream_id,
&d->addr, component_id,
&d->base_addr, d->type,
d->transport, &d->addr,
d->priority, &d->base_addr,
d->username, d->transport,
d->password, d->priority,
d->foundation); d->username,
if (res) d->password,
++added; d->foundation);
else if (res)
added = -1; ++added;
else
added = -1;
}
} }
conn_check_remote_candidates_set(agent); conn_check_remote_candidates_set(agent);
......
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