From 3c90dbe7237da89670d7ed8f10c547d50bff108e Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Thu, 22 Jun 2017 00:09:59 +0200 Subject: [PATCH] fixed ip reporting for dns look ups --- .../siacs/conversations/utils/AndroidUsingLinkProperties.java | 4 ++-- src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/utils/AndroidUsingLinkProperties.java b/src/main/java/eu/siacs/conversations/utils/AndroidUsingLinkProperties.java index c184d7227..4e137a7ed 100644 --- a/src/main/java/eu/siacs/conversations/utils/AndroidUsingLinkProperties.java +++ b/src/main/java/eu/siacs/conversations/utils/AndroidUsingLinkProperties.java @@ -56,9 +56,9 @@ public class AndroidUsingLinkProperties extends AbstractDNSServerLookupMechanism List out = new ArrayList<>(); for(InetAddress addr : in) { if (addr instanceof Inet4Address) { - out.add(0, addr.toString()); + out.add(0, addr.getHostAddress()); } else { - out.add(addr.toString()); + out.add(addr.getHostAddress()); } } return out; diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java index 10cf576c5..ebff04d0b 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java @@ -366,7 +366,7 @@ public class XmppConnection implements Runnable { addr = new InetSocketAddress(result.getIp(), result.getPort()); Log.d(Config.LOGTAG, account.getJid().toBareJid().toString() + ": using values from dns " + result.getHostname().toString() - + "[" + result.getIp().toString() + "]:" + result.getPort() + " tls: " + features.encryptionEnabled); + + "/" + result.getIp().getHostAddress() + ":" + result.getPort() + " tls: " + features.encryptionEnabled); } else { addr = new InetSocketAddress(result.getHostname().toString(), result.getPort()); Log.d(Config.LOGTAG, account.getJid().toBareJid().toString()