X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=ircd%2Fm_who.c;h=c4fd81f2a93a805fa891865905f2d9648b6bb990;hb=9b1f5beca29ec78141f19a19d689f0f7cc3fe3ac;hp=797b5a87e581be327f8c113c3b7c3af810e8193e;hpb=9e97df973e333c18f65f251a213fcf736e52653f;p=ircu2.10.12-pk.git diff --git a/ircd/m_who.c b/ircd/m_who.c index 797b5a8..c4fd81f 100644 --- a/ircd/m_who.c +++ b/ircd/m_who.c @@ -351,12 +351,14 @@ int m_who(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) real mask and try to match all relevant fields */ if (!(commas || (counter < 1))) { + struct irc_in_addr imask; int minlen, cset; - static struct in_mask imask; + unsigned char ibits; + if (mask) { matchcomp(mymask, &minlen, &cset, mask); - if (matchcompIP(&imask, mask)) + if (!ipmask_parse(mask, &imask, &ibits)) matchsel &= ~WHO_FIELD_NIP; if ((minlen > NICKLEN) || !(cset & NTL_IRCNK)) matchsel &= ~WHO_FIELD_NIC; @@ -401,9 +403,7 @@ int m_who(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) || matchexec(cli_info(acptr), mymask, minlen)) && ((!(matchsel & WHO_FIELD_NIP)) || (HasHiddenHost(acptr) && !IsAnOper(sptr)) - || ((((cli_ip(acptr).s_addr & imask.mask.s_addr) != - imask.bits.s_addr)) || (imask.fall - && matchexec(ircd_ntoa((const char*) &(cli_ip(acptr))), mymask, minlen))))) + || !ipmask_check(&cli_ip(acptr), &imask, ibits))) continue; if (!SHOW_MORE(sptr, counter)) break; @@ -439,9 +439,7 @@ int m_who(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) || matchexec(cli_info(acptr), mymask, minlen)) && ((!(matchsel & WHO_FIELD_NIP)) || (HasHiddenHost(acptr) && !IsAnOper(sptr)) - || ((((cli_ip(acptr).s_addr & imask.mask.s_addr) != imask.bits.s_addr)) - || (imask.fall - && matchexec(ircd_ntoa((const char*) &(cli_ip(acptr))), mymask, minlen))))) + || !ipmask_check(&cli_ip(acptr), &imask, ibits))) continue; if (!SHOW_MORE(sptr, counter)) break;