From d860805af76ec85e003bf3019407bbb7acd218c9 Mon Sep 17 00:00:00 2001
From: Tobias Markmann <tm@ayena.de>
Date: Sun, 1 Feb 2015 16:33:39 +0100
Subject: Fix IPv6 name resolution on Linux systems

Boost query objects are setup with the flag address_configured by
default which only does IPv6 resoltuion if a non-loopback device is
found. This detection mechanism does not seem to work. At least in my
test VM there was a non-loopback device with IPv6 address and it still
reported no IPv6 addresses. Setting the flag to passive will
have it always send queries for AAAA records.

Test-Informatioon:

Tested on Mac OS X 10.9.5 and Elementary OS 0.2.1 (Linux).

Change-Id: I346bcb7982dee465aa7847a7bae8981a16f2d3bc

diff --git a/Swiften/Network/PlatformDomainNameAddressQuery.cpp b/Swiften/Network/PlatformDomainNameAddressQuery.cpp
index ad7ba2a..99e5eda 100644
--- a/Swiften/Network/PlatformDomainNameAddressQuery.cpp
+++ b/Swiften/Network/PlatformDomainNameAddressQuery.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2015 Isode Limited.
  * All rights reserved.
  * See the COPYING file for more information.
  */
@@ -31,7 +31,7 @@ void PlatformDomainNameAddressQuery::runBlocking() {
 	}
 	//std::cout << "PlatformDomainNameResolver::doRun()" << std::endl;
 	boost::asio::ip::tcp::resolver resolver(ioService);
-	boost::asio::ip::tcp::resolver::query query(hostname, "5222");
+	boost::asio::ip::tcp::resolver::query query(hostname, "5222", boost::asio::ip::resolver_query_base::passive);
 	try {
 		//std::cout << "PlatformDomainNameResolver::doRun(): Resolving" << std::endl;
 		boost::asio::ip::tcp::resolver::iterator endpointIterator = resolver.resolve(query);
-- 
cgit v0.10.2-6-g49f6