diff options
author | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2014-02-18 21:16:29 +0000 |
---|---|---|
committer | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2014-02-18 21:16:29 +0000 |
commit | fdeb045add7198e20baf78c9dd8c3969ed0028f2 (patch) | |
tree | 02d410bcba912e0d1486fa4b9cd8c459a2f69d03 /src | |
parent | c678dd256fefdf4d60330540ffd13104290009a7 (diff) |
- hostmask.c: get rid of this (type & ~0x1) hack
git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/branches/8.1.x@2996 82007160-df01-0410-b94d-b575c5fd34c7
Diffstat (limited to 'src')
-rw-r--r-- | src/hostmask.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/hostmask.c b/src/hostmask.c index d830929..a58cb29 100644 --- a/src/hostmask.c +++ b/src/hostmask.c @@ -481,12 +481,12 @@ find_conf_by_address(const char *name, struct irc_ssaddr *addr, unsigned int typ { arec = ptr->data; - if (arec->type == (type & ~0x1) && + if ((arec->type == type) && arec->precedence > hprecv && arec->masktype == HM_IPV6 && match_ipv6(addr, &arec->Mask.ipa.addr, arec->Mask.ipa.bits) && - (type & 0x1 || !cmpfunc(arec->username, username)) && + (!username || !cmpfunc(arec->username, username)) && (IsNeedPassword(arec->conf) || arec->conf->passwd == NULL || match_conf_password(password, arec->conf))) { @@ -506,12 +506,12 @@ find_conf_by_address(const char *name, struct irc_ssaddr *addr, unsigned int typ { arec = ptr->data; - if (arec->type == (type & ~0x1) && + if ((arec->type == type) && arec->precedence > hprecv && arec->masktype == HM_IPV4 && match_ipv4(addr, &arec->Mask.ipa.addr, arec->Mask.ipa.bits) && - (type & 0x1 || !cmpfunc(arec->username, username)) && + (!username || !cmpfunc(arec->username, username)) && (IsNeedPassword(arec->conf) || arec->conf->passwd == NULL || match_conf_password(password, arec->conf))) { @@ -532,11 +532,11 @@ find_conf_by_address(const char *name, struct irc_ssaddr *addr, unsigned int typ DLINK_FOREACH(ptr, atable[hash_text(p)].head) { arec = ptr->data; - if ((arec->type == (type & ~0x1)) && + if ((arec->type == type) && arec->precedence > hprecv && (arec->masktype == HM_HOST) && !cmpfunc(arec->Mask.hostname, name) && - (type & 0x1 || !cmpfunc(arec->username, username)) && + (!username || !cmpfunc(arec->username, username)) && (IsNeedPassword(arec->conf) || arec->conf->passwd == NULL || match_conf_password(password, arec->conf))) { @@ -554,11 +554,11 @@ find_conf_by_address(const char *name, struct irc_ssaddr *addr, unsigned int typ { arec = ptr->data; - if (arec->type == (type & ~0x1) && + if (arec->type == type && arec->precedence > hprecv && arec->masktype == HM_HOST && !cmpfunc(arec->Mask.hostname, name) && - (type & 0x1 || !cmpfunc(arec->username, username)) && + (!username || !cmpfunc(arec->username, username)) && (IsNeedPassword(arec->conf) || arec->conf->passwd == NULL || match_conf_password(password, arec->conf))) { @@ -623,12 +623,11 @@ find_dline_conf(struct irc_ssaddr *addr, int aftype) { struct MaskItem *eline; - eline = find_conf_by_address(NULL, addr, CONF_EXEMPT | 1, aftype, - NULL, NULL, 1); + eline = find_conf_by_address(NULL, addr, CONF_EXEMPT, aftype, NULL, NULL, 1); if (eline != NULL) return eline; - return find_conf_by_address(NULL, addr, CONF_DLINE | 1, aftype, NULL, NULL, 1); + return find_conf_by_address(NULL, addr, CONF_DLINE, aftype, NULL, NULL, 1); } /* void add_conf_by_address(int, struct MaskItem *aconf) |