X-Git-Url: https://jfr.im/git/solanum.git/blobdiff_plain/d20d0045506623457e157e06260889b9e4001c0a..8bd5767b953efd089e0467b02f897f77581e589d:/modules/m_dline.c diff --git a/modules/m_dline.c b/modules/m_dline.c index 317bb244..42c134ec 100644 --- a/modules/m_dline.c +++ b/modules/m_dline.c @@ -36,14 +36,13 @@ #include "numeric.h" #include "s_conf.h" #include "s_newconf.h" -#include "s_log.h" +#include "logger.h" #include "send.h" #include "hash.h" #include "s_serv.h" #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 **); @@ -77,6 +76,7 @@ mo_dline(struct Client *client_p, struct Client *source_p, const char *dlhost; char *oper_reason; char *reason = def; + struct rb_sockaddr_storage daddr; char cidr_form_host[HOSTLEN + 1]; struct ConfItem *aconf; int bits; @@ -149,40 +149,39 @@ 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); -#ifdef IPV6 - if(ty == HM_IPV6) - t = AF_INET6; - else -#endif - t = AF_INET; - - if((aconf = find_dline((struct sockaddr *)&daddr)) != NULL) - { - int bx; - parse_netmask(aconf->host, NULL, &bx); - if(b >= bx) - { - creason = aconf->passwd ? aconf->passwd : ""; - if(IsConfExemptKline(aconf)) - sendto_one_notice(source_p, - ":[%s] is (E)d-lined by [%s] - %s", - dlhost, aconf->host, creason); - else - sendto_one_notice(source_p, - ":[%s] already D-lined by [%s] - %s", - dlhost, aconf->host, creason); - return 0; - } - } + if(ConfigFileEntry.non_redundant_klines) + { + const char *creason; + int t = AF_INET, ty, b; + ty = parse_netmask(dlhost, (struct sockaddr *)&daddr, &b); +#ifdef RB_IPV6 + if(ty == HM_IPV6) + t = AF_INET6; + else +#endif + t = AF_INET; + + if((aconf = find_dline((struct sockaddr *)&daddr, t)) != NULL) + { + int bx; + parse_netmask(aconf->host, NULL, &bx); + if(b >= bx) + { + creason = aconf->passwd ? aconf->passwd : ""; + 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); + else + sendto_one(source_p, + ":%s NOTICE %s :[%s] already D-lined by [%s] - %s", + me.name, parv[0], dlhost, aconf->host, creason); + return 0; + } + } } - set_time(); + rb_set_time(); current_date = smalldate(); aconf = make_conf();