diff options
author | Christian Schneppe <christian@pix-art.de> | 2019-09-06 22:11:04 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2019-09-06 22:11:04 +0200 |
commit | 132203117614153c85352caff4af169b97be7c17 (patch) | |
tree | a6192c1e05d6917ca5638dae53a4dc23b497b066 /src/main | |
parent | 75548eafa43786dfbe90571e8a6dfeaa6b7cdddd (diff) |
do not include link local in direct candidates
Diffstat (limited to 'src/main')
3 files changed, 12 insertions, 16 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 3292e65e4..55ac15b24 100644 --- a/src/main/java/de/pixart/messenger/xmpp/jingle/DirectConnectionUtils.java +++ b/src/main/java/de/pixart/messenger/xmpp/jingle/DirectConnectionUtils.java @@ -26,9 +26,10 @@ public class DirectConnectionUtils { final Enumeration<InetAddress> inetAddressEnumeration = networkInterface.getInetAddresses(); while (inetAddressEnumeration.hasMoreElements()) { final InetAddress inetAddress = inetAddressEnumeration.nextElement(); - if (!inetAddress.isLoopbackAddress()) { - addresses.add(inetAddress); + if (inetAddress.isLoopbackAddress() || inetAddress.isLinkLocalAddress()) { + continue; } + addresses.add(inetAddress); } } return addresses; diff --git a/src/main/java/de/pixart/messenger/xmpp/jingle/JingleCandidate.java b/src/main/java/de/pixart/messenger/xmpp/jingle/JingleCandidate.java index 40d6f077b..063c1a39d 100644 --- a/src/main/java/de/pixart/messenger/xmpp/jingle/JingleCandidate.java +++ b/src/main/java/de/pixart/messenger/xmpp/jingle/JingleCandidate.java @@ -110,15 +110,12 @@ public class JingleCandidate { } public static JingleCandidate parse(Element candidate) { - JingleCandidate parsedCandidate = new JingleCandidate( - candidate.getAttribute("cid"), false); + JingleCandidate parsedCandidate = new JingleCandidate(candidate.getAttribute("cid"), false); parsedCandidate.setHost(candidate.getAttribute("host")); parsedCandidate.setJid(InvalidJid.getNullForInvalid(candidate.getAttributeAsJid("jid"))); parsedCandidate.setType(candidate.getAttribute("type")); - parsedCandidate.setPriority(Integer.parseInt(candidate - .getAttribute("priority"))); - parsedCandidate - .setPort(Integer.parseInt(candidate.getAttribute("port"))); + parsedCandidate.setPriority(Integer.parseInt(candidate.getAttribute("priority"))); + parsedCandidate.setPort(Integer.parseInt(candidate.getAttribute("port"))); return parsedCandidate; } diff --git a/src/main/java/de/pixart/messenger/xmpp/jingle/JingleConnection.java b/src/main/java/de/pixart/messenger/xmpp/jingle/JingleConnection.java index f23473356..d403f8b75 100644 --- a/src/main/java/de/pixart/messenger/xmpp/jingle/JingleConnection.java +++ b/src/main/java/de/pixart/messenger/xmpp/jingle/JingleConnection.java @@ -324,22 +324,20 @@ public class JingleConnection implements Transferable { @Override public void failed() { - Log.d(Config.LOGTAG, - "connection to our own primary candidete failed"); + Log.d(Config.LOGTAG, "connection to our own proxy65 candidete failed"); sendInitRequest(); } @Override public void established() { - Log.d(Config.LOGTAG, - "successfully connected to our own primary candidate"); + Log.d(Config.LOGTAG, "successfully connected to our own proxy65 candidate"); mergeCandidate(candidate); sendInitRequest(); } }); mergeCandidate(candidate); } else { - Log.d(Config.LOGTAG, "no primary candidate of our own was found"); + Log.d(Config.LOGTAG, "no proxy65 candidate of our own was found"); sendInitRequest(); } }); @@ -626,7 +624,7 @@ public class JingleConnection implements Transferable { @Override public void failed() { - Log.d(Config.LOGTAG, "connection to our own primary candidate failed"); + Log.d(Config.LOGTAG, "connection to our own proxy65 candidate failed"); content.socks5transport().setChildren(getCandidatesAsElements()); packet.setContent(content); sendJinglePacket(packet); @@ -635,7 +633,7 @@ public class JingleConnection implements Transferable { @Override public void established() { - Log.d(Config.LOGTAG, "connected to primary candidate"); + Log.d(Config.LOGTAG, "connected to proxy candidate"); mergeCandidate(candidate); content.socks5transport().setChildren(getCandidatesAsElements()); packet.setContent(content); @@ -644,7 +642,7 @@ public class JingleConnection implements Transferable { } }); } else { - Log.d(Config.LOGTAG, "did not find a primary candidate for ourselves"); + Log.d(Config.LOGTAG, "did not find a proxy65 candidate for ourselves"); content.socks5transport().setChildren(getCandidatesAsElements()); packet.setContent(content); sendJinglePacket(packet); |