summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-11-21 15:52:38 -0500
committerAdam <Adam@anope.org>2013-11-21 15:52:38 -0500
commitcc01e2144c2c9a0fd5c71c9a32300906aa14a246 (patch)
treeff723f2f6dac22c9decd5b127b81d61a1dc301c6 /src
parentd96b9715d1637f42a5b397e65471cd062b98c88c (diff)
Allow multiple allowmasks in link blocks, #679
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_spanningtree/link.h2
-rw-r--r--src/modules/m_spanningtree/utils.cpp9
2 files changed, 7 insertions, 4 deletions
diff --git a/src/modules/m_spanningtree/link.h b/src/modules/m_spanningtree/link.h
index b318c9bf2..21213fb3e 100644
--- a/src/modules/m_spanningtree/link.h
+++ b/src/modules/m_spanningtree/link.h
@@ -30,7 +30,7 @@ class Link : public refcountbase
std::string SendPass;
std::string RecvPass;
std::string Fingerprint;
- std::string AllowMask;
+ std::vector<std::string> AllowMasks;
bool HiddenFromStats;
std::string Hook;
int Timeout;
diff --git a/src/modules/m_spanningtree/utils.cpp b/src/modules/m_spanningtree/utils.cpp
index 6c3ee703c..c9abbd008 100644
--- a/src/modules/m_spanningtree/utils.cpp
+++ b/src/modules/m_spanningtree/utils.cpp
@@ -227,8 +227,7 @@ void SpanningTreeUtilities::RefreshIPCache()
continue;
}
- if (L->AllowMask.length())
- ValidIPs.push_back(L->AllowMask);
+ std::copy(L->AllowMasks.begin(), L->AllowMasks.end(), std::back_inserter(ValidIPs));
irc::sockets::sockaddrs dummy;
bool ipvalid = irc::sockets::aptosa(L->IPAddr, L->Port, dummy);
@@ -277,7 +276,11 @@ void SpanningTreeUtilities::ReadConfiguration()
reference<Link> L = new Link(tag);
std::string linkname = tag->getString("name");
L->Name = linkname.c_str();
- L->AllowMask = tag->getString("allowmask");
+
+ irc::spacesepstream sep = tag->getString("allowmask");
+ for (std::string s; sep.GetToken(s);)
+ L->AllowMasks.push_back(s);
+
L->IPAddr = tag->getString("ipaddr");
L->Port = tag->getInt("port");
L->SendPass = tag->getString("sendpass", tag->getString("password"));