]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
m_spanningtree Allow multiple valid ips for link blocks as a result of SecurityIPResolver
authorAdam <Adam@anope.org>
Fri, 2 Sep 2016 16:43:13 +0000 (12:43 -0400)
committerAttila Molnar <attilamolnar@hush.com>
Fri, 2 Sep 2016 18:19:30 +0000 (20:19 +0200)
src/modules/m_spanningtree/resolvers.cpp

index 6d5875af2c4e72401fc571817d1b09844de03cec..ded0573afeec2c50cd2b069f4bea63e674bfd6f9 100644 (file)
@@ -105,14 +105,17 @@ SecurityIPResolver::SecurityIPResolver(Module* me, DNS::Manager* mgr, const std:
 
 void SecurityIPResolver::OnLookupComplete(const DNS::Query *r)
 {
-       const DNS::ResourceRecord &ans_record = r->answers[0];
-
        for (std::vector<reference<Link> >::iterator i = Utils->LinkBlocks.begin(); i != Utils->LinkBlocks.end(); ++i)
        {
                Link* L = *i;
                if (L->IPAddr == host)
                {
-                       Utils->ValidIPs.push_back(ans_record.rdata);
+                       for (std::vector<DNS::ResourceRecord>::const_iterator j = r->answers.begin(); j != r->answers.end(); ++j)
+                       {
+                               const DNS::ResourceRecord& ans_record = *j;
+                               if (ans_record.type == this->question.type)
+                                       Utils->ValidIPs.push_back(ans_record.rdata);
+                       }
                        break;
                }
        }