#include "handlers.h"
#endif /* 0 */
#include "client.h"
-#include "crule.h"
#include "hash.h"
#include "ircd.h"
#include "ircd_log.h"
struct Client* bcptr;
struct Client* LHcptr = 0;
struct ConfItem* aconf = 0;
- struct ConfItem* cconf;
struct ConfItem* lhconf = 0;
struct Jupe* ajupe = 0;
int hop;
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 "
struct Client* bcptr;
struct Client* LHcptr = 0;
struct ConfItem* aconf = 0;
- struct ConfItem* cconf;
struct ConfItem* lhconf = 0;
struct Jupe* ajupe = 0;
int hop;
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;
struct Client* bcptr;
struct Client* LHcptr = 0;
struct ConfItem* aconf = 0;
- struct ConfItem* cconf;
struct ConfItem* lhconf = 0;
struct Jupe* ajupe = 0;
int hop;
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;