]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - modules/m_dline.c
report_error() cleanup
[irc/rqf/shadowircd.git] / modules / m_dline.c
index 317bb24478bc6ffcc9ecb52ae4d4c46fd6766de7..32cc408c42ef112ba48bcf32088ee3ec48955f77 100644 (file)
@@ -43,7 +43,6 @@
 #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,37 +149,36 @@ mo_dline(struct Client *client_p, struct Client *source_p,
                }
        }
 
-       if(ConfigFileEntry.non_redundant_klines)\r
-       {\r
-               struct rb_sockaddr_storage daddr;\r
-               const char *creason;\r
-               int t = AF_INET, ty, b;\r
-               ty = parse_netmask(dlhost, (struct sockaddr *)&daddr, &b);\r
-#ifdef IPV6\r
-               if(ty == HM_IPV6)\r
-                       t = AF_INET6;\r
-               else\r
-#endif\r
-                       t = AF_INET;\r
-                                               \r
-               if((aconf = find_dline((struct sockaddr *)&daddr)) != NULL)\r
-               {\r
-                       int bx;\r
-                       parse_netmask(aconf->host, NULL, &bx);\r
-                       if(b >= bx)\r
-                       {\r
-                               creason = aconf->passwd ? aconf->passwd : "<No Reason>";\r
-                               if(IsConfExemptKline(aconf))\r
-                                       sendto_one_notice(source_p, \r
-                                                         ":[%s] is (E)d-lined by [%s] - %s",\r
-                                                         dlhost, aconf->host, creason);\r
-                               else\r
-                                       sendto_one_notice(source_p, \r
-                                                         ":[%s] already D-lined by [%s] - %s",\r
-                                                         dlhost, aconf->host, creason);\r
-                               return 0;\r
-                       }\r
-               }\r
+       if(ConfigFileEntry.non_redundant_klines)
+       {
+               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, t)) != NULL)
+               {
+                       int bx;
+                       parse_netmask(aconf->host, NULL, &bx);
+                       if(b >= bx)
+                       {
+                               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);
+                               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();