diff --git a/modules/m_gline.c b/modules/m_gline.c index 8301c87a..9add8545 100644 --- a/modules/m_gline.c +++ b/modules/m_gline.c @@ -684,47 +684,46 @@ majority_gline(struct Client *source_p, const char *user, return NO; } -/* remove_temp_gline() - * - * inputs - username, hostname to ungline - * outputs - - * side effects - tries to ungline anything that matches - */ -static int -remove_temp_gline(const char *user, const char *host) -{ - struct ConfItem *aconf; - rb_dlink_node *ptr; - struct rb_sockaddr_storage addr, caddr; - int bits, cbits; - int mtype, gtype; - - mtype = parse_netmask(host, (struct sockaddr *)&addr, &bits); - - RB_DLINK_FOREACH(ptr, glines.head) - { - aconf = ptr->data; - - gtype = parse_netmask(aconf->host, (struct sockaddr *)&caddr, &cbits); - - if(gtype != mtype || (user && irccmp(user, aconf->user))) - continue; - - if(gtype == HM_HOST) - { - if(irccmp(aconf->host, host)) - continue; - } - else if(bits != cbits || - !comp_with_mask_sock((struct sockaddr *)&addr, - (struct sockaddr *)&caddr, bits)) - continue; - - rb_dlinkDestroy(ptr, &glines); - remove_reject_mask(aconf->user, aconf->host); - delete_one_address_conf(aconf->host, aconf); - return YES; - } - - return NO; +/* remove_temp_gline() + * + * inputs - username, hostname to ungline + * outputs - + * side effects - tries to ungline anything that matches + */ +static int +remove_temp_gline(const char *user, const char *host) +{ + struct ConfItem *aconf; + rb_dlink_node *ptr; + struct rb_sockaddr_storage addr, caddr; + int bits, cbits; + int mtype, gtype; + + mtype = parse_netmask(host, (struct sockaddr *)&addr, &bits); + + RB_DLINK_FOREACH(ptr, glines.head) + { + aconf = ptr->data; + + gtype = parse_netmask(aconf->host, (struct sockaddr *)&caddr, &cbits); + + if(gtype != mtype || (user && irccmp(user, aconf->user))) + continue; + + if(gtype == HM_HOST) + { + if(irccmp(aconf->host, host)) + continue; + } + else if(bits != cbits || + !comp_with_mask_sock((struct sockaddr *)&addr, + (struct sockaddr *)&caddr, bits)) + continue; + + rb_dlinkDestroy(ptr, &glines); + delete_one_address_conf(aconf->host, aconf); + return YES; + } + + return NO; }