summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_check.cpp4
-rw-r--r--src/modules/m_connectban.cpp11
-rw-r--r--src/modules/m_httpd.cpp2
-rw-r--r--src/modules/m_httpd_stats.cpp2
-rw-r--r--src/modules/m_spanningtree/treesocket1.cpp2
-rw-r--r--src/modules/m_spanningtree/utils.cpp4
6 files changed, 13 insertions, 12 deletions
diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp
index 158b0c533..0a0ecab2b 100644
--- a/src/modules/m_check.cpp
+++ b/src/modules/m_check.cpp
@@ -104,8 +104,8 @@ class CommandCheck : public Command
LocalUser* loctarg = IS_LOCAL(targuser);
if (loctarg)
{
- user->SendText(checkstr + " clientaddr " + irc::sockets::satouser(&loctarg->client_sa));
- user->SendText(checkstr + " serveraddr " + irc::sockets::satouser(&loctarg->server_sa));
+ user->SendText(checkstr + " clientaddr " + irc::sockets::satouser(loctarg->client_sa));
+ user->SendText(checkstr + " serveraddr " + irc::sockets::satouser(loctarg->server_sa));
std::string classname = loctarg->GetClass()->name;
if (!classname.empty())
diff --git a/src/modules/m_connectban.cpp b/src/modules/m_connectban.cpp
index 9506bc2fe..735f3da99 100644
--- a/src/modules/m_connectban.cpp
+++ b/src/modules/m_connectban.cpp
@@ -81,7 +81,8 @@ class ModuleConnectBan : public Module
break;
}
- i = connects.find(u->GetCIDRMask(range));
+ irc::string mask = assign(irc::sockets::mask(u->client_sa, range));
+ i = connects.find(mask);
if (i != connects.end())
{
@@ -90,21 +91,21 @@ class ModuleConnectBan : public Module
if (i->second >= threshold)
{
// Create zline for set duration.
- ZLine* zl = new ZLine(ServerInstance->Time(), banduration, ServerInstance->Config->ServerName.c_str(), "Connect flooding", u->GetCIDRMask(range));
+ ZLine* zl = new ZLine(ServerInstance->Time(), banduration, ServerInstance->Config->ServerName.c_str(), "Connect flooding", mask.c_str());
if (ServerInstance->XLines->AddLine(zl,NULL))
ServerInstance->XLines->ApplyLines();
else
delete zl;
ServerInstance->SNO->WriteGlobalSno('x',"Module m_connectban added Z:line on *@%s to expire on %s: Connect flooding",
- u->GetCIDRMask(range), ServerInstance->TimeString(zl->expiry).c_str());
- ServerInstance->SNO->WriteGlobalSno('a', "Connect flooding from IP range %s (%d)", u->GetCIDRMask(range), threshold);
+ mask.c_str(), ServerInstance->TimeString(zl->expiry).c_str());
+ ServerInstance->SNO->WriteGlobalSno('a', "Connect flooding from IP range %s (%d)", mask.c_str(), threshold);
connects.erase(i);
}
}
else
{
- connects[u->GetCIDRMask(range)] = 1;
+ connects[mask] = 1;
}
}
diff --git a/src/modules/m_httpd.cpp b/src/modules/m_httpd.cpp
index 7fc342e04..748f530ca 100644
--- a/src/modules/m_httpd.cpp
+++ b/src/modules/m_httpd.cpp
@@ -343,7 +343,7 @@ class ModuleHttpServer : public Module
return MOD_RES_PASSTHRU;
int port;
std::string incomingip;
- irc::sockets::satoap(client, incomingip, port);
+ irc::sockets::satoap(*client, incomingip, port);
new HttpServerSocket(nfd, incomingip, from, client, server);
return MOD_RES_ALLOW;
}
diff --git a/src/modules/m_httpd_stats.cpp b/src/modules/m_httpd_stats.cpp
index 7e478ade4..a0aa202ab 100644
--- a/src/modules/m_httpd_stats.cpp
+++ b/src/modules/m_httpd_stats.cpp
@@ -171,7 +171,7 @@ class ModuleHttpStats : public Module
LocalUser* lu = IS_LOCAL(u);
if (lu)
data << "<port>" << lu->GetServerPort() << "</port><servaddr>"
- << irc::sockets::satouser(&lu->server_sa) << "</servaddr>";
+ << irc::sockets::satouser(lu->server_sa) << "</servaddr>";
data << "<ipaddress>" << u->GetIPString() << "</ipaddress>";
DumpMeta(data, u);
diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp
index 962b63984..b8633ae14 100644
--- a/src/modules/m_spanningtree/treesocket1.cpp
+++ b/src/modules/m_spanningtree/treesocket1.cpp
@@ -73,7 +73,7 @@ TreeSocket::TreeSocket(SpanningTreeUtilities* Util, int newfd, ListenSocket* via
: BufferedSocket(newfd), Utils(Util)
{
int dummy;
- irc::sockets::satoap(client, IP, dummy);
+ irc::sockets::satoap(*client, IP, dummy);
age = ServerInstance->Time();
LinkState = WAIT_AUTH_1;
capab_phase = 0;
diff --git a/src/modules/m_spanningtree/utils.cpp b/src/modules/m_spanningtree/utils.cpp
index 11c96bf7c..0b9b8da3b 100644
--- a/src/modules/m_spanningtree/utils.cpp
+++ b/src/modules/m_spanningtree/utils.cpp
@@ -32,7 +32,7 @@ ModResult ModuleSpanningTree::OnAcceptConnection(int newsock, ListenSocket* from
bool found = false;
int port;
std::string incomingip;
- irc::sockets::satoap(client, incomingip, port);
+ irc::sockets::satoap(*client, incomingip, port);
found = (std::find(Utils->ValidIPs.begin(), Utils->ValidIPs.end(), incomingip) != Utils->ValidIPs.end());
if (!found)
@@ -335,7 +335,7 @@ void SpanningTreeUtilities::RefreshIPCache()
ValidIPs.push_back(L->AllowMask);
irc::sockets::sockaddrs dummy;
- bool ipvalid = irc::sockets::aptosa(L->IPAddr, L->Port, &dummy);
+ bool ipvalid = irc::sockets::aptosa(L->IPAddr, L->Port, dummy);
if (ipvalid)
ValidIPs.push_back(L->IPAddr);
else