From c9a81b53b3a31c3938fecdf75f67b43574b23fd2 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Mon, 9 Sep 2019 20:18:38 +0200 Subject: do not include scope in ipv6 annoucment --- .../pixart/messenger/xmpp/jingle/DirectConnectionUtils.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/main/java/de/pixart/messenger/xmpp') diff --git a/src/main/java/de/pixart/messenger/xmpp/jingle/DirectConnectionUtils.java b/src/main/java/de/pixart/messenger/xmpp/jingle/DirectConnectionUtils.java index 55ac15b24..ee2e0f0fe 100644 --- a/src/main/java/de/pixart/messenger/xmpp/jingle/DirectConnectionUtils.java +++ b/src/main/java/de/pixart/messenger/xmpp/jingle/DirectConnectionUtils.java @@ -1,8 +1,10 @@ package de.pixart.messenger.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; -- cgit v1.2.3