diff options
author | Adam <Adam@anope.org> | 2016-01-19 15:39:14 -0500 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2016-08-25 17:18:05 +0200 |
commit | 754f0130893bacb2b69a32c3de9ed1b3da9659cd (patch) | |
tree | 99aa366956a6368d8fd5f6521fe5b40073e0c15d | |
parent | 14556541bb12fda6e7af8273458f680386e9c438 (diff) |
spanningtree: use bindip aftype as a hint for dns lookup type
-rw-r--r-- | src/modules/m_spanningtree/main.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index f26b3c828..fda420434 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -200,7 +200,6 @@ void ModuleSpanningTree::ConnectServer(Link* x, Autoconnect* y) return; } - DNS::QueryType start_type = DNS::QUERY_AAAA; if (strchr(x->IPAddr.c_str(),':')) { in6_addr n; @@ -236,6 +235,15 @@ void ModuleSpanningTree::ConnectServer(Link* x, Autoconnect* y) } else { + // Guess start_type from bindip aftype + DNS::QueryType start_type = DNS::QUERY_AAAA; + irc::sockets::sockaddrs bind; + if ((!x->Bind.empty()) && (irc::sockets::aptosa(x->Bind, 0, bind))) + { + if (bind.sa.sa_family == AF_INET) + start_type = DNS::QUERY_A; + } + ServernameResolver* snr = new ServernameResolver(*DNS, x->IPAddr, x, start_type, y); try { |