+2005-09-12 Michael Poole <mdpoole@troilus.org>
+
+ * ircd/channel.c (find_ban): Compare ban mask against hostname
+ even when it looks like an IP, to match things like *!*@1.* when
+ users have a hostname like 1.2.3.example.com.
+
2005-09-12 Michael Poole <mdpoole@troilus.org>
* RELEASE.NOTES: Note the resolution of ambiguous ipmasks.
/* Compare host portion of ban. */
hostmask = banlist->banstr + banlist->nu_len + 1;
if (((banlist->flags & BAN_IPMASK)
- ? !ipmask_check(&cli_ip(cptr), &banlist->address, banlist->addrbits)
- : match(hostmask, iphost))
- && match(hostmask, cli_user(cptr)->host)
- && !(sr && match(hostmask, sr) == 0))
- continue;
- /* If an exception matches, no ban can match. */
- if (banlist->flags & BAN_EXCEPTION)
- return NULL;
- /* Otherwise, remember this ban but keep searching for an exception. */
- found = banlist;
+ && ipmask_check(&cli_ip(cptr), &banlist->address, banlist->addrbits))
+ || match(hostmask, cli_user(cptr)->host)
+ || (sr && match(hostmask, sr) == 0)) {
+ /* If an exception matches, no ban can match. */
+ if (banlist->flags & BAN_EXCEPTION)
+ return NULL;
+ /* Otherwise, remember this ban but keep searching for an exception. */
+ found = banlist;
+ }
}
return found;
}