From e3cea4d8112d6520df10dd3a72c81e7c889d5ecd Mon Sep 17 00:00:00 2001 From: Simon Arlott Date: Sun, 23 Jul 2017 14:59:22 +0100 Subject: [PATCH] ircd: serv_connect: don't try to connect if that would exceed the class limit --- ircd/s_serv.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ircd/s_serv.c b/ircd/s_serv.c index e727bb4d..a0d1b16c 100644 --- a/ircd/s_serv.c +++ b/ircd/s_serv.c @@ -1090,6 +1090,16 @@ serv_connect(struct server_conf *server_p, struct Client *by) 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 */ if(GET_SS_FAMILY(&sa_connect) == AF_UNSPEC) {