summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-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())
{