diff options
| author | Adam <Adam@anope.org> | 2013-05-08 09:50:43 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2013-05-08 09:50:43 -0400 |
| commit | 9b07e163c0e1ceed30e72aead2338b47ef2da1b2 (patch) | |
| tree | 4c13bd545846700a58c5526c3e4e9a6fdf0afc87 /modules/protocol/inspircd12.cpp | |
| parent | 6859decfb8ed0430e946ff81eca4f9da879f69c9 (diff) | |
Make sockaddrs/cidr not throw on invalid ips to give us an easier/cheaper way to test for a valid IP
Diffstat (limited to 'modules/protocol/inspircd12.cpp')
| -rw-r--r-- | modules/protocol/inspircd12.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/modules/protocol/inspircd12.cpp b/modules/protocol/inspircd12.cpp index c3fa04b85..d46d8733e 100644 --- a/modules/protocol/inspircd12.cpp +++ b/modules/protocol/inspircd12.cpp @@ -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()); } |
