ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid-7.2/src/channel.c
(Generate patch)

Comparing ircd-hybrid-7.2/src/channel.c (file contents):
Revision 370 by adx, Mon Jan 2 22:05:15 2006 UTC vs.
Revision 371 by michael, Tue Jan 10 10:45:48 2006 UTC

# Line 31 | Line 31
31   #include "client.h"
32   #include "common.h"
33   #include "hash.h"
34 + #include "hostmask.h"
35   #include "irc_string.h"
36   #include "sprintf_irc.h"
37   #include "ircd.h"
# Line 616 | Line 617 | find_bmask(const struct Client *who, con
617  
618    DLINK_FOREACH(ptr, list->head)
619    {
620 <    const struct Ban *bp = ptr->data;
620 >    struct Ban *bp = ptr->data;
621  
622 <    if (match(bp->name, who->name) &&
623 <        match(bp->username, who->username) &&
624 <        (match(bp->host, who->host) ||
625 <         match(bp->host, who->sockhost) ||
626 <         match_cidr(bp->host, who->sockhost)))
627 <      return 1;
622 >    if (match(bp->name, who->name) && match(bp->username, who->username))
623 >    {
624 >      switch (bp->type)
625 >      {
626 >        case HM_HOST:
627 >          if (match(bp->host, who->host) || match(bp->host, who->sockhost))
628 >            return 1;
629 >          break;
630 >        case HM_IPV4:
631 >          if (who->localClient->aftype == AF_INET)
632 >            if (match_ipv4(&who->localClient->ip, &bp->addr, bp->bits))
633 >              return 1;
634 >          break;
635 > #ifdef IPV6
636 >        case HM_IPV6:
637 >          if (who->localClient->aftype == AF_INET6)
638 >            if (match_ipv6(&who->localClient->ip, &bp->addr, bp->bits))
639 >              return 1;
640 >          break;
641 > #endif
642 >        default:
643 >          assert(0);
644 >      }
645 >    }
646    }
647  
648    return 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines