summaryrefslogtreecommitdiff
path: root/src/AbstractCommand.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-03-31 00:57:33 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-03-31 18:02:45 +0900
commitf4a098754429019c356f6480238ff5cf941ed391 (patch)
tree7fa5afe019475d3c2c1e4fe09ffaee9ff36ce6b4 /src/AbstractCommand.cc
parent56fac58b4d05e1fc97ac37195c7a8cbacb08fb07 (diff)
Check non-loopback (and non-linklocak for IPv6) address is configured
Issue A record query only when non-loopback IPv4 address is configured. Likewise, issue AAA record query only when non-loopback and non-linklocak IPv6 address is configured.
Diffstat (limited to 'src/AbstractCommand.cc')
-rw-r--r--src/AbstractCommand.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/AbstractCommand.cc b/src/AbstractCommand.cc
index cba4e0b3..478dbf33 100644
--- a/src/AbstractCommand.cc
+++ b/src/AbstractCommand.cc
@@ -107,7 +107,11 @@ AbstractCommand::AbstractCommand
requestGroup_->increaseStreamCommand();
requestGroup_->increaseNumCommand();
#ifdef ENABLE_ASYNC_DNS
- if(e_->getOption()->getAsBool(PREF_DISABLE_IPV6)) {
+ if(!net::getIPv4AddrConfigured()) {
+ asyncNameResolverMan_->setIPv4(false);
+ }
+ if(!net::getIPv6AddrConfigured() ||
+ e_->getOption()->getAsBool(PREF_DISABLE_IPV6)) {
asyncNameResolverMan_->setIPv6(false);
}
#endif // ENABLE_ASYNC_DNS