util: Use default resolver behavior in util::dns::Resolver
As of this commit, we are using the default behavior of
boost::asio::ip::resolver (only return IPv4 addresses if a non-loopback
IPv4 address is configured for the system; only return IPv6 addresses if
a non-loopback IPv6 address is configured for the system).
Unit tests are now conditioned upon availability of IPv4/IPv6 and will
not fail if IPv4 or IPv6 addresses cannot be resolved.
Change-Id: I8d7fa9a205ad26a2ca85fd22d582ffe6b0a02a92
Refs: #2415
diff --git a/src/util/dns.cpp b/src/util/dns.cpp
index 8df097f..98f53d5 100644
--- a/src/util/dns.cpp
+++ b/src/util/dns.cpp
@@ -49,12 +49,7 @@
const time::nanoseconds& timeout,
const shared_ptr<Resolver>& self)
{
- BoostResolver::query query(host, NULL_PORT
-
-#if not defined(__FreeBSD__)
- , BoostResolver::query::all_matching
-#endif
- );
+ BoostResolver::query query(host, NULL_PORT);
m_resolver.async_resolve(query, bind(&Resolver::onResolveSuccess, this, _1, _2, self));
@@ -144,11 +139,7 @@
{
Resolver resolver(SuccessCallback(), ErrorCallback(), addressSelector, ioService);
- BoostResolver::query query(host, Resolver::NULL_PORT
-#if not defined(__FreeBSD__)
- , BoostResolver::query::all_matching
-#endif
- );
+ BoostResolver::query query(host, Resolver::NULL_PORT);
BoostResolver::iterator remoteEndpoint = resolver.syncResolve(query);