diff options
author | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2014-02-19 10:01:40 +0000 |
---|---|---|
committer | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2014-02-19 10:01:40 +0000 |
commit | c1ac8385d48a33a4db0c4adf4ed07fdbbaf453d6 (patch) | |
tree | f5eb995c527f6ed69531af0d1f076f47aba76b07 /src | |
parent | a0bbfa2aec48a0d0de9efb16431dcc1c22c4d3ef (diff) |
- hostmask.c: minor cleanups to add_conf_by_address()
git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/branches/8.1.x@3002 82007160-df01-0410-b94d-b575c5fd34c7
Diffstat (limited to 'src')
-rw-r--r-- | src/hostmask.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/hostmask.c b/src/hostmask.c index 31b2857..014d1be 100644 --- a/src/hostmask.c +++ b/src/hostmask.c @@ -636,22 +636,16 @@ find_dline_conf(struct irc_ssaddr *addr, int aftype) struct AddressRec * add_conf_by_address(const unsigned int type, struct MaskItem *conf) { - const char *address; - const char *username; + const char *hostname = conf->host; + const char *username = conf->user; static unsigned int prec_value = 0xFFFFFFFF; int bits = 0; - struct AddressRec *arec; - - address = conf->host; - username = conf->user; - - assert(type); + struct AddressRec *arec = NULL; - if (EmptyString(address)) - address = "/NOMATCH!/"; + assert(type && hostname); arec = MyMalloc(sizeof(struct AddressRec)); - arec->masktype = parse_netmask(address, &arec->Mask.ipa.addr, &bits); + arec->masktype = parse_netmask(hostname, &arec->Mask.ipa.addr, &bits); arec->Mask.ipa.bits = bits; arec->username = username; arec->conf = conf; @@ -673,8 +667,8 @@ add_conf_by_address(const unsigned int type, struct MaskItem *conf) break; #endif default: /* HM_HOST */ - arec->Mask.hostname = address; - dlinkAdd(arec, &arec->node, &atable[get_mask_hash(address)]); + arec->Mask.hostname = hostname; + dlinkAdd(arec, &arec->node, &atable[get_mask_hash(hostname)]); break; } |