ircd: serv_connect: don't try to connect if that would exceed the class limit

This commit is contained in:
Simon Arlott 2017-07-23 14:59:22 +01:00
parent fdfe62e7cc
commit e3cea4d811
No known key found for this signature in database
GPG key ID: C8975F2043CA5D24

View file

@ -1090,6 +1090,16 @@ serv_connect(struct server_conf *server_p, struct Client *by)
return 0; return 0;
} }
if (CurrUsers(server_p->class) >= MaxUsers(server_p->class)) {
sendto_realops_snomask(SNO_GENERAL, L_ALL,
"No more connections allowed in class \"%s\" for server %s",
server_p->class->class_name, server_p->name);
if(by && IsPerson(by) && !MyClient(by))
sendto_one_notice(by, ":No more connections allowed in class \"%s\" for server %s",
server_p->class->class_name, server_p->name);
return 0;
}
/* create a socket for the server connection */ /* create a socket for the server connection */
if(GET_SS_FAMILY(&sa_connect) == AF_UNSPEC) if(GET_SS_FAMILY(&sa_connect) == AF_UNSPEC)
{ {