summaryrefslogtreecommitdiff
path: root/agent/agent.c
diff options
context:
space:
mode:
authorJohan Sternerup <johast@axis.com>2022-01-20 15:47:11 +0100
committerJohan Sternerup <johast@axis.com>2022-04-06 08:40:23 +0200
commit526eec8beaf9068b66caab6e1f941ec574e3b82a (patch)
treedd979631aa81f69e550fd350037253aa75422d8b /agent/agent.c
parent642714943a554898645921eb39aa28d26da3f65c (diff)
downloadlibnice-526eec8beaf9068b66caab6e1f941ec574e3b82a.tar.gz
Don't try to use link-local addresses outside local network
If we have gathered a host IP-address that is link-local we should never try to use it for anything else than trying to match it with another link-local address. Some routers seem to have problems with traffic from link-local addresses destined at external IP-addresses. By definition link-local addresses should stay local so there's no reason to access STUN/TURN from it or try to form a candidate with another address that is not link-local.
Diffstat (limited to 'agent/agent.c')
-rw-r--r--agent/agent.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/agent/agent.c b/agent/agent.c
index b96b8e0..0765ad9 100644
--- a/agent/agent.c
+++ b/agent/agent.c
@@ -3455,6 +3455,7 @@ nice_agent_gather_candidates (
/* TODO: Add server-reflexive support for TCP candidates */
if (agent->full_mode && agent->stun_server_ip && !agent->force_relay &&
+ !nice_address_is_linklocal (addr) &&
transport == NICE_CANDIDATE_TRANSPORT_UDP) {
NiceAddress stun_server;
if (nice_address_set_from_string (&stun_server, agent->stun_server_ip)) {
@@ -3470,7 +3471,7 @@ nice_agent_gather_candidates (
}
}
- if (agent->full_mode && component &&
+ if (agent->full_mode && component && !nice_address_is_linklocal (addr) &&
transport != NICE_CANDIDATE_TRANSPORT_TCP_PASSIVE) {
GList *item;
int host_ip_version = nice_address_ip_version (&host_candidate->c.addr);