From dd9777a6b71b4b1a0cea8e46c26fa4fab1de24b8 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sun, 8 Sep 2019 17:44:26 +0200 Subject: [PATCH] do not include scope in ipv6 annoucment --- .../xmpp/jingle/DirectConnectionUtils.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/DirectConnectionUtils.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/DirectConnectionUtils.java index d418e4e93..8d9818ed9 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/DirectConnectionUtils.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/DirectConnectionUtils.java @@ -1,8 +1,10 @@ package eu.siacs.conversations.xmpp.jingle; +import java.net.Inet6Address; import java.net.InetAddress; import java.net.NetworkInterface; import java.net.SocketException; +import java.net.UnknownHostException; import java.security.SecureRandom; import java.util.ArrayList; import java.util.Enumeration; @@ -29,7 +31,16 @@ public class DirectConnectionUtils { if (inetAddress.isLoopbackAddress() || inetAddress.isLinkLocalAddress()) { continue; } - addresses.add(inetAddress); + if (inetAddress instanceof Inet6Address) { + //let's get rid of scope + try { + addresses.add(Inet6Address.getByAddress(inetAddress.getAddress())); + } catch (UnknownHostException e) { + //ignored + } + } else { + addresses.add(inetAddress); + } } } return addresses;