fixing dline
This commit is contained in:
parent
39bdbd3f7d
commit
6f24a013bf
3 changed files with 39 additions and 36 deletions
|
@ -43,6 +43,7 @@
|
|||
#include "msg.h"
|
||||
#include "parse.h"
|
||||
#include "modules.h"
|
||||
#include "reject.h"
|
||||
|
||||
static int mo_dline(struct Client *, struct Client *, int, const char **);
|
||||
static int mo_undline(struct Client *, struct Client *, int, const char **);
|
||||
|
@ -151,6 +152,7 @@ mo_dline(struct Client *client_p, struct Client *source_p,
|
|||
|
||||
if(ConfigFileEntry.non_redundant_klines)
|
||||
{
|
||||
struct rb_sockaddr_storage daddr;
|
||||
const char *creason;
|
||||
int t = AF_INET, ty, b;
|
||||
ty = parse_netmask(dlhost, (struct sockaddr *)&daddr, &b);
|
||||
|
@ -161,7 +163,7 @@ mo_dline(struct Client *client_p, struct Client *source_p,
|
|||
#endif
|
||||
t = AF_INET;
|
||||
|
||||
if((aconf = find_dline((struct sockaddr *)&daddr, t)) != NULL)
|
||||
if((aconf = find_dline((struct sockaddr *)&daddr)) != NULL)
|
||||
{
|
||||
int bx;
|
||||
parse_netmask(aconf->host, NULL, &bx);
|
||||
|
@ -169,13 +171,13 @@ mo_dline(struct Client *client_p, struct Client *source_p,
|
|||
{
|
||||
creason = aconf->passwd ? aconf->passwd : "<No Reason>";
|
||||
if(IsConfExemptKline(aconf))
|
||||
sendto_one(source_p,
|
||||
":%s NOTICE %s :[%s] is (E)d-lined by [%s] - %s",
|
||||
me.name, parv[0], dlhost, aconf->host, creason);
|
||||
sendto_one_notice(source_p,
|
||||
":[%s] is (E)d-lined by [%s] - %s",
|
||||
dlhost, aconf->host, creason);
|
||||
else
|
||||
sendto_one(source_p,
|
||||
":%s NOTICE %s :[%s] already D-lined by [%s] - %s",
|
||||
me.name, parv[0], dlhost, aconf->host, creason);
|
||||
sendto_one_notice(source_p,
|
||||
":[%s] already D-lined by [%s] - %s",
|
||||
dlhost, aconf->host, creason);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include "s_conf.h"
|
||||
#include "s_newconf.h"
|
||||
#include "sprintf_irc.h"
|
||||
#include "reject.h"
|
||||
|
||||
static int mo_testline(struct Client *, struct Client *, int, const char **);
|
||||
static int mo_testgecos(struct Client *, struct Client *, int, const char **);
|
||||
|
|
12
src/s_conf.c
12
src/s_conf.c
|
@ -195,7 +195,7 @@ check_client(struct Client *client_p, struct Client *source_p, const char *usern
|
|||
source_p->name, IsGotId(source_p) ? "" : "~",
|
||||
source_p->username, source_p->sockhost);
|
||||
|
||||
ServerStats->is_ref++;
|
||||
ServerStats.is_ref++;
|
||||
exit_client(client_p, source_p, &me, "Too many host connections (local)");
|
||||
break;
|
||||
|
||||
|
@ -209,7 +209,7 @@ check_client(struct Client *client_p, struct Client *source_p, const char *usern
|
|||
source_p->name, IsGotId(source_p) ? "" : "~",
|
||||
source_p->username, source_p->sockhost);
|
||||
|
||||
ServerStats->is_ref++;
|
||||
ServerStats.is_ref++;
|
||||
exit_client(client_p, source_p, &me, "Too many host connections (global)");
|
||||
break;
|
||||
|
||||
|
@ -223,7 +223,7 @@ check_client(struct Client *client_p, struct Client *source_p, const char *usern
|
|||
source_p->name, IsGotId(source_p) ? "" : "~",
|
||||
source_p->username, source_p->sockhost);
|
||||
|
||||
ServerStats->is_ref++;
|
||||
ServerStats.is_ref++;
|
||||
exit_client(client_p, source_p, &me, "Too many user connections (global)");
|
||||
break;
|
||||
|
||||
|
@ -238,7 +238,7 @@ check_client(struct Client *client_p, struct Client *source_p, const char *usern
|
|||
source_p->name, IsGotId(source_p) ? "" : "~",
|
||||
source_p->username, source_p->sockhost);
|
||||
|
||||
ServerStats->is_ref++;
|
||||
ServerStats.is_ref++;
|
||||
exit_client(client_p, source_p, &me,
|
||||
"No more connections allowed in your connection class");
|
||||
break;
|
||||
|
@ -253,7 +253,7 @@ check_client(struct Client *client_p, struct Client *source_p, const char *usern
|
|||
#endif
|
||||
port = ntohs(((struct sockaddr_in *)&source_p->localClient->listener->addr)->sin_port);
|
||||
|
||||
ServerStats->is_ref++;
|
||||
ServerStats.is_ref++;
|
||||
/* jdc - lists server name & port connections are on */
|
||||
/* a purely cosmetical change */
|
||||
/* why ipaddr, and not just source_p->sockhost? --fl */
|
||||
|
@ -281,7 +281,7 @@ check_client(struct Client *client_p, struct Client *source_p, const char *usern
|
|||
}
|
||||
case BANNED_CLIENT:
|
||||
exit_client(client_p, client_p, &me, "*** Banned ");
|
||||
ServerStats->is_ref++;
|
||||
ServerStats.is_ref++;
|
||||
break;
|
||||
|
||||
case 0:
|
||||
|
|
Loading…
Reference in a new issue