summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-06-06 23:03:57 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-06-06 23:03:57 +0000
commit3327dcb7ce99dd5dbdc60086fe7b5ae74c3065ed (patch)
tree3d5178d6cdf983dfc18fcd57a255e4e633817ebf
parent3d506cfd7d49625f83b3c962f9a06cf043f6b2b5 (diff)
Fix bug from std::string porting, thanks ThunderHacker
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9856 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/modules/m_spanningtree/treesocket2.cpp3
-rw-r--r--src/modules/m_spanningtree/utils.cpp2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp
index 5d2471b2c..63ab83623 100644
--- a/src/modules/m_spanningtree/treesocket2.cpp
+++ b/src/modules/m_spanningtree/treesocket2.cpp
@@ -679,7 +679,7 @@ int TreeSocket::OnIncomingConnection(int newsock, char* ip)
{
for (std::vector<std::string>::iterator i = Utils->ValidIPs.begin(); i != Utils->ValidIPs.end(); i++)
{
- if ((*i) == "*" || irc::sockets::MatchCIDR(ip, (*i).c_str()))
+ if (*i == "*" || irc::sockets::MatchCIDR(ip, *i))
{
found = true;
break;
@@ -689,6 +689,7 @@ int TreeSocket::OnIncomingConnection(int newsock, char* ip)
if (!found)
{
Utils->Creator->RemoteMessage(NULL,"Server connection from %s denied (no link blocks with that IP address)", ip);
+ Instance->Logs->Log("m_spanningtree", DEBUG, "There are %lu allowed ips in the ValidIPs list", ValidIPs.size());
Instance->SE->Close(newsock);
return false;
}
diff --git a/src/modules/m_spanningtree/utils.cpp b/src/modules/m_spanningtree/utils.cpp
index cfbb9add0..388725637 100644
--- a/src/modules/m_spanningtree/utils.cpp
+++ b/src/modules/m_spanningtree/utils.cpp
@@ -348,7 +348,7 @@ void SpanningTreeUtilities::RefreshIPCache()
ValidIPs.clear();
for (std::vector<Link>::iterator L = LinkBlocks.begin(); L != LinkBlocks.end(); L++)
{
- if (L->IPAddr.empty() || L->RecvPass.empty() || L->SendPass.empty() || L->Name.empty() || L->Port)
+ if (L->IPAddr.empty() || L->RecvPass.empty() || L->SendPass.empty() || L->Name.empty() || !L->Port)
{
if (L->Name.empty())
{