/[svn]/ircd-hybrid/branches/8.1.x/src/hostmask.c
ViewVC logotype

Diff of /ircd-hybrid/branches/8.1.x/src/hostmask.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3001 by michael, Tue Feb 18 21:26:08 2014 UTC revision 3002 by michael, Wed Feb 19 10:01:40 2014 UTC
# Line 636  find_dline_conf(struct irc_ssaddr *addr, Line 636  find_dline_conf(struct irc_ssaddr *addr,
636  struct AddressRec *  struct AddressRec *
637  add_conf_by_address(const unsigned int type, struct MaskItem *conf)  add_conf_by_address(const unsigned int type, struct MaskItem *conf)
638  {  {
639    const char *address;    const char *hostname = conf->host;
640    const char *username;    const char *username = conf->user;
641    static unsigned int prec_value = 0xFFFFFFFF;    static unsigned int prec_value = 0xFFFFFFFF;
642    int bits = 0;    int bits = 0;
643    struct AddressRec *arec;    struct AddressRec *arec = NULL;
644    
645    address = conf->host;    assert(type && hostname);
   username = conf->user;  
   
   assert(type);  
   
   if (EmptyString(address))  
     address = "/NOMATCH!/";  
646    
647    arec = MyMalloc(sizeof(struct AddressRec));    arec = MyMalloc(sizeof(struct AddressRec));
648    arec->masktype = parse_netmask(address, &arec->Mask.ipa.addr, &bits);    arec->masktype = parse_netmask(hostname, &arec->Mask.ipa.addr, &bits);
649    arec->Mask.ipa.bits = bits;    arec->Mask.ipa.bits = bits;
650    arec->username = username;    arec->username = username;
651    arec->conf = conf;    arec->conf = conf;
# Line 673  add_conf_by_address(const unsigned int t Line 667  add_conf_by_address(const unsigned int t
667        break;        break;
668  #endif  #endif
669      default: /* HM_HOST */      default: /* HM_HOST */
670        arec->Mask.hostname = address;        arec->Mask.hostname = hostname;
671        dlinkAdd(arec, &arec->node, &atable[get_mask_hash(address)]);        dlinkAdd(arec, &arec->node, &atable[get_mask_hash(hostname)]);
672        break;        break;
673    }    }
674    

Legend:
Removed from v.3001  
changed lines
  Added in v.3002

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.28