1
0
mirror of https://github.com/anope/anope.git synced 2026-07-01 14:46:39 +02:00

Make sockaddrs/cidr not throw on invalid ips to give us an easier/cheaper way to test for a valid IP

This commit is contained in:
Adam
2013-05-08 09:50:43 -04:00
parent 6859decfb8
commit 9b07e163c0
16 changed files with 212 additions and 244 deletions
+5 -4
View File
@@ -180,14 +180,15 @@ class InspIRCd12Proto : public IRCDProto
}
/* ZLine if we can instead */
if (x->GetUser() == "*" && x->GetHost().find_first_not_of("0123456789:.") == Anope::string::npos)
try
if (x->GetUser() == "*")
{
sockaddrs addr(x->GetHost());
if (addr.valid())
{
sockaddrs(x->GetHost());
IRCD->SendSZLine(u, x);
return;
}
catch (const SocketException &) { }
}
SendAddLine("G", x->GetUser() + "@" + x->GetHost(), timeleft, x->by, x->GetReason());
}