summaryrefslogtreecommitdiff
path: root/modules/protocol/bahamut.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/protocol/bahamut.cpp')
-rw-r--r--modules/protocol/bahamut.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/modules/protocol/bahamut.cpp b/modules/protocol/bahamut.cpp
index 6aa097433..f485bd62c 100644
--- a/modules/protocol/bahamut.cpp
+++ b/modules/protocol/bahamut.cpp
@@ -143,14 +143,15 @@ class BahamutIRCdProto : public IRCDProto
return;
/* ZLine if we can instead */
- if (x->GetUser() == "*" && x->GetHost().find_first_not_of("0123456789:.") == Anope::string::npos)
- try
+ if (x->GetUser() == "*")
+ {
+ sockaddrs a(x->GetHost());
+ if (a.valid())
{
- sockaddrs(x->GetHost());
IRCD->SendSZLineDel(x);
return;
}
- catch (const SocketException &) { }
+ }
UplinkSocket::Message() << "RAKILL " << x->GetHost() << " " << x->GetUser();
}
@@ -214,14 +215,15 @@ class BahamutIRCdProto : 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 a(x->GetHost());
+ if (a.valid())
{
- sockaddrs(x->GetHost());
IRCD->SendSZLine(u, x);
return;
}
- catch (const SocketException &) { }
+ }
// Calculate the time left before this would expire, capping it at 2 days
time_t timeleft = x->expires - Anope::CurTime;