X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=ircd%2Fchannel.c;h=d14e04f697aefbd9afead8553dec8e1251b4c22a;hb=23e173891aafc7778efbc6bef585fa1a536bf8f2;hp=e1ea3bada13b16d934942606ad7756522a879740;hpb=8c39d84bf5df9597ad188e11ded8fbe765854b76;p=ircu2.10.12-pk.git diff --git a/ircd/channel.c b/ircd/channel.c index e1ea3ba..d14e04f 100644 --- a/ircd/channel.c +++ b/ircd/channel.c @@ -380,16 +380,16 @@ struct Ban *find_ban(struct Client *cptr, struct Ban *banlist) continue; /* Compare host portion of ban. */ hostmask = banlist->banstr + banlist->nu_len + 1; - if (((banlist->flags & BAN_IPMASK) + if (!((banlist->flags & BAN_IPMASK) && ipmask_check(&cli_ip(cptr), &banlist->address, banlist->addrbits)) - || match(hostmask, cli_user(cptr)->host) - || (sr && match(hostmask, sr) == 0)) { - /* If an exception matches, no ban can match. */ - if (banlist->flags & BAN_EXCEPTION) - return NULL; - /* Otherwise, remember this ban but keep searching for an exception. */ - found = banlist; - } + && match(hostmask, cli_user(cptr)->host) + && !(sr && match(hostmask, sr))) + continue; + /* If an exception matches, no ban can match. */ + if (banlist->flags & BAN_EXCEPTION) + return NULL; + /* Otherwise, remember this ban but keep searching for an exception. */ + found = banlist; } return found; }