summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/m_dline.c28
-rw-r--r--modules/m_gline.c12
-rw-r--r--modules/m_kline.c28
-rw-r--r--modules/m_stats.c3
-rw-r--r--modules/m_testline.c2
-rw-r--r--modules/m_xline.c5
6 files changed, 35 insertions, 43 deletions
diff --git a/modules/m_dline.c b/modules/m_dline.c
index c375707..d61bf16 100644
--- a/modules/m_dline.c
+++ b/modules/m_dline.c
@@ -96,25 +96,23 @@ remove_dline_match(const char *host)
{
struct irc_ssaddr iphost, *piphost;
struct MaskItem *conf;
- int t;
+ int t = 0;
+ int aftype = 0;
if ((t = parse_netmask(host, &iphost, NULL)) != HM_HOST)
{
#ifdef IPV6
if (t == HM_IPV6)
- t = AF_INET6;
+ aftype = AF_INET6;
else
#endif
- t = AF_INET;
+ aftype = AF_INET;
piphost = &iphost;
}
else
- {
- t = 0;
piphost = NULL;
- }
- if ((conf = find_conf_by_address(host, piphost, CONF_DLINE, t, NULL, NULL, 0)))
+ if ((conf = find_conf_by_address(host, piphost, CONF_DLINE, aftype, NULL, NULL, 0)))
{
if (IsConfDatabase(conf))
{
@@ -148,7 +146,7 @@ mo_dline(struct Client *client_p, struct Client *source_p,
struct irc_ssaddr daddr;
struct MaskItem *conf=NULL;
time_t tkline_time=0;
- int bits, t;
+ int bits = 0, aftype = 0, t = 0;
const char *current_date = NULL;
time_t cur_time;
char hostip[HOSTIPLEN + 1];
@@ -231,14 +229,14 @@ mo_dline(struct Client *client_p, struct Client *source_p,
#ifdef IPV6
if (t == HM_IPV6)
- t = AF_INET6;
+ aftype = AF_INET6;
else
#endif
- t = AF_INET;
+ aftype = AF_INET;
parse_netmask(dlhost, &daddr, NULL);
- if ((conf = find_dline_conf(&daddr, t)) != NULL)
+ if ((conf = find_dline_conf(&daddr, aftype)) != NULL)
{
creason = conf->reason ? conf->reason : def_reason;
if (IsConfExemptKline(conf))
@@ -283,7 +281,7 @@ ms_dline(struct Client *client_p, struct Client *source_p,
struct irc_ssaddr daddr;
struct MaskItem *conf=NULL;
time_t tkline_time=0;
- int bits, t;
+ int bits = 0, aftype = 0, t = 0;
const char *current_date = NULL;
time_t cur_time;
char hostip[HOSTIPLEN + 1];
@@ -350,14 +348,14 @@ ms_dline(struct Client *client_p, struct Client *source_p,
#ifdef IPV6
if (t == HM_IPV6)
- t = AF_INET6;
+ aftype= AF_INET6;
else
#endif
- t = AF_INET;
+ aftype = AF_INET;
parse_netmask(dlhost, &daddr, NULL);
- if ((conf = find_dline_conf(&daddr, t)) != NULL)
+ if ((conf = find_dline_conf(&daddr, aftype)) != NULL)
{
creason = conf->reason ? conf->reason : def_reason;
if (IsConfExemptKline(conf))
diff --git a/modules/m_gline.c b/modules/m_gline.c
index f0e18b5..ecc96d9 100644
--- a/modules/m_gline.c
+++ b/modules/m_gline.c
@@ -94,25 +94,23 @@ remove_gline_match(const char *user, const char *host)
{
struct irc_ssaddr iphost, *piphost;
struct MaskItem *conf;
- int t;
+ int t = 0;
+ int aftype = 0;
if ((t = parse_netmask(host, &iphost, NULL)) != HM_HOST)
{
#ifdef IPV6
if (t == HM_IPV6)
- t = AF_INET6;
+ aftype = AF_INET6;
else
#endif
- t = AF_INET;
+ aftype = AF_INET;
piphost = &iphost;
}
else
- {
- t = 0;
piphost = NULL;
- }
- if ((conf = find_conf_by_address(host, piphost, CONF_GLINE, t, user, NULL, 0)))
+ if ((conf = find_conf_by_address(host, piphost, CONF_GLINE, aftype, user, NULL, 0)))
{
if (IsConfDatabase(conf))
{
diff --git a/modules/m_kline.c b/modules/m_kline.c
index 513b860..d4a646a 100644
--- a/modules/m_kline.c
+++ b/modules/m_kline.c
@@ -257,25 +257,23 @@ already_placed_kline(struct Client *source_p, const char *luser, const char *lho
const char *reason;
struct irc_ssaddr iphost, *piphost;
struct MaskItem *conf = NULL;
- int t;
+ int t = 0;
+ int aftype = 0;
- if ((t = parse_netmask(lhost, &iphost, &t)) != HM_HOST)
+ if ((t = parse_netmask(lhost, &iphost, NULL)) != HM_HOST)
{
#ifdef IPV6
if (t == HM_IPV6)
- t = AF_INET6;
+ aftype = AF_INET6;
else
#endif
- t = AF_INET;
+ aftype = AF_INET;
piphost = &iphost;
}
else
- {
- t = 0;
piphost = NULL;
- }
- if ((conf = find_conf_by_address(lhost, piphost, CONF_KLINE, t, luser, NULL, 0)))
+ if ((conf = find_conf_by_address(lhost, piphost, CONF_KLINE, aftype, luser, NULL, 0)))
{
if (warn)
{
@@ -428,26 +426,24 @@ static int
remove_kline_match(const char *host, const char *user)
{
struct irc_ssaddr iphost, *piphost;
- struct MaskItem *conf = NULL;
- int t;
+ struct MaskItem *conf;
+ int t = 0;
+ int aftype = 0;
if ((t = parse_netmask(host, &iphost, NULL)) != HM_HOST)
{
#ifdef IPV6
if (t == HM_IPV6)
- t = AF_INET6;
+ aftype = AF_INET6;
else
#endif
- t = AF_INET;
+ aftype = AF_INET;
piphost = &iphost;
}
else
- {
- t = 0;
piphost = NULL;
- }
- if ((conf = find_conf_by_address(host, piphost, CONF_KLINE, t, user, NULL, 0)))
+ if ((conf = find_conf_by_address(host, piphost, CONF_KLINE, aftype, user, NULL, 0)))
{
if (IsConfDatabase(conf))
{
diff --git a/modules/m_stats.c b/modules/m_stats.c
index 2c292e6..ed75e39 100644
--- a/modules/m_stats.c
+++ b/modules/m_stats.c
@@ -31,6 +31,7 @@
#include "listener.h" /* show_ports */
#include "s_gline.h"
#include "conf.h"
+#include "conf_class.h"
#include "hostmask.h"
#include "numeric.h" /* ERR_xxx */
#include "send.h" /* sendto_one */
@@ -265,7 +266,7 @@ stats_memory(struct Client *source_p, int parc, char *parv[])
}
#endif
/* count up all classes */
- class_count = dlink_list_length(&class_items);
+ class_count = dlink_list_length(class_get_list());
count_whowas_memory(&wwu, &wwm);
watch_count_memory(&watch_list_headers, &watch_list_memory);
diff --git a/modules/m_testline.c b/modules/m_testline.c
index 086b141..674f9c7 100644
--- a/modules/m_testline.c
+++ b/modules/m_testline.c
@@ -62,7 +62,7 @@ mo_testline(struct Client *client_p, struct Client *source_p,
struct MaskItem *conf = NULL;
struct irc_ssaddr ip;
int host_mask;
- int t;
+ enum hostmask_type t;
int matches = 0;
char userhost[HOSTLEN + USERLEN + 2];
struct split_nuh_item nuh;
diff --git a/modules/m_xline.c b/modules/m_xline.c
index e512ac2..dfdaaeb 100644
--- a/modules/m_xline.c
+++ b/modules/m_xline.c
@@ -361,10 +361,9 @@ write_xline(struct Client *source_p, char *gecos, char *reason,
get_oper_name(source_p), conf->name,
conf->reason);
sendto_one(source_p,
- ":%s NOTICE %s :Added X-Line [%s] [%d] [%s]",
+ ":%s NOTICE %s :Added X-Line [%s] [%s]",
MyConnect(source_p) ? me.name : ID_or_name(&me, source_p->from),
- source_p->name, conf->name,
- conf->action, conf->reason);
+ source_p->name, conf->name, conf->reason);
ilog(LOG_TYPE_IRCD, "%s added X-Line for [%s] [%s]",
get_oper_name(source_p), conf->name, conf->reason);
}