X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=ircd%2Fm_server.c;h=2a63dcbe032ae26f91058ef355e37e25ab2fd7cd;hb=86c7c44bf12024a47fac109fac01c7dbde88fd0d;hp=491b5e14b3606488513faff861e3bb8ff4ca2272;hpb=dd339ee3f84171935b3d0b10a5fade3d73503d7c;p=ircu2.10.12-pk.git diff --git a/ircd/m_server.c b/ircd/m_server.c index 491b5e1..2a63dcb 100644 --- a/ircd/m_server.c +++ b/ircd/m_server.c @@ -88,7 +88,6 @@ #include "handlers.h" #endif /* 0 */ #include "client.h" -#include "crule.h" #include "hash.h" #include "ircd.h" #include "ircd_log.h" @@ -138,7 +137,6 @@ int mr_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) struct Client* bcptr; struct Client* LHcptr = 0; struct ConfItem* aconf = 0; - struct ConfItem* cconf; struct ConfItem* lhconf = 0; struct Jupe* ajupe = 0; int hop; @@ -301,16 +299,12 @@ int mr_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) cptr->hopcount = hop; /* check connection rules */ - for (cconf = GlobalConfList; cconf; cconf = cconf->next) { - if ((cconf->status == CONF_CRULEALL) && (match(cconf->host, host) == 0)) { - if (crule_eval(cconf->passwd)) { - ServerStats->is_ref++; - sendto_opmask_butone(0, SNO_OLDSNO, "Refused connection from %s.", - cptr->name); - return exit_client(cptr, cptr, &me, "Disallowed by connection rule"); - } - } + if (0 != conf_eval_crule(host, CRULE_ALL)) { + ServerStats->is_ref++; + sendto_opmask_butone(0, SNO_OLDSNO, "Refused connection from %s.", cptr->name); + return exit_client(cptr, cptr, &me, "Disallowed by connection rule"); } + if (conf_check_server(cptr)) { ++ServerStats->is_ref; sendto_opmask_butone(0, SNO_OLDSNO, "Received unauthorized connection " @@ -813,7 +807,6 @@ int ms_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) struct Client* bcptr; struct Client* LHcptr = 0; struct ConfItem* aconf = 0; - struct ConfItem* cconf; struct ConfItem* lhconf = 0; struct Jupe* ajupe = 0; int hop; @@ -978,16 +971,10 @@ int ms_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) cptr->hopcount = hop; /* check connection rules */ - for (cconf = GlobalConfList; cconf; cconf = cconf->next) { - if ((cconf->status == CONF_CRULEALL) && (match(cconf->host, host) == 0)) { - if (crule_eval(cconf->passwd)) - { - ServerStats->is_ref++; - sendto_opmask_butone(0, SNO_OLDSNO, "Refused connection from %s.", - cptr->name); - return exit_client(cptr, cptr, &me, "Disallowed by connection rule"); - } - } + if (0 != conf_eval_crule(host, CRULE_ALL)) { + ServerStats->is_ref++; + sendto_opmask_butone(0, SNO_OLDSNO, "Refused connection from %s.", cptr->name); + return exit_client(cptr, cptr, &me, "Disallowed by connection rule"); } if (conf_check_server(cptr)) { ++ServerStats->is_ref; @@ -1489,7 +1476,6 @@ int m_server(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) struct Client* bcptr; struct Client* LHcptr = 0; struct ConfItem* aconf = 0; - struct ConfItem* cconf; struct ConfItem* lhconf = 0; struct Jupe* ajupe = 0; int hop; @@ -1649,15 +1635,10 @@ int m_server(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) cptr->hopcount = hop; /* check connection rules */ - for (cconf = GlobalConfList; cconf; cconf = cconf->next) { - if ((cconf->status == CONF_CRULEALL) && (match(cconf->host, host) == 0)) { - if (crule_eval(cconf->passwd)) - { - ServerStats->is_ref++; - sendto_ops("Refused connection from %s.", cptr->name); /* XXX DEAD */ - return exit_client(cptr, cptr, &me, "Disallowed by connection rule"); - } - } + if (0 != conf_eval_crule(host, CRULE_ALL)) { + ServerStats->is_ref++; + sendto_ops("Refused connection from %s.", cptr->name); /* XXX DEAD */ + return exit_client(cptr, cptr, &me, "Disallowed by connection rule"); } if (conf_check_server(cptr)) { ++ServerStats->is_ref;