diff options
author | Christian Schneppe <christian@pix-art.de> | 2019-09-09 20:18:38 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2019-09-09 20:18:38 +0200 |
commit | c9a81b53b3a31c3938fecdf75f67b43574b23fd2 (patch) | |
tree | d95005a272a7b3a7d8d97ab890c591a6565f0b32 /src/main | |
parent | ea4b999d8a1e4457d4296b4d1fb66ff55b2afd29 (diff) |
do not include scope in ipv6 annoucment
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/de/pixart/messenger/xmpp/jingle/DirectConnectionUtils.java | 13 |
1 files changed, 12 insertions, 1 deletions
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; |