diff options
-rw-r--r-- | plugins/ice/src/plugin.vala | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/ice/src/plugin.vala b/plugins/ice/src/plugin.vala index 4abf042c..ec4fe9cb 100644 --- a/plugins/ice/src/plugin.vala +++ b/plugins/ice/src/plugin.vala @@ -31,9 +31,14 @@ public class Dino.Plugins.Ice.Plugin : RootInterface, Object { Gee.List<Xep.ExternalServiceDiscovery.Service> services = yield ExternalServiceDiscovery.request_services(stream); foreach (Xep.ExternalServiceDiscovery.Service service in services) { if (service.transport == "udp" && (service.ty == "stun" || service.ty == "turn")) { - InetAddress ip = yield lookup_ipv4_addess(service.host); + InetAddress? ip = yield lookup_ipv4_addess(service.host); if (ip == null) continue; + if (ip.is_any || ip.is_link_local || ip.is_loopback || ip.is_multicast || ip.is_site_local) { + warning("Ignoring STUN/TURN server at %s", service.host); + continue; + } + if (service.ty == "stun") { debug("Server offers STUN server: %s:%u, resolved to %s", service.host, service.port, ip.to_string()); ice_udp_module.stun_ip = ip.to_string(); |