+2006-04-03 Michael Poole <mdpoole@troilus.org>
+
+ * ircd/channel.c (bmatch): If ipmask_check() indicates old_ban is
+ a CIDR-wise superset of new_ban, check whether new_ban is a
+ text-wise superset of old_ban.
+
2006-03-31 Michael Poole <mdpoole@troilus.org>
* tools/iauth-test (send_server_notice): Use a colon prefix before
old_ban->banstr[old_ban->nu_len] = new_ban->banstr[new_ban->nu_len] = '@';
if (res)
return res;
- /* Compare the addresses. */
- return !ipmask_check(&new_ban->address, &old_ban->address, old_ban->addrbits);
+ /* If the old ban's mask mismatches, cannot be a superset. */
+ if (!ipmask_check(&new_ban->address, &old_ban->address, old_ban->addrbits))
+ return 1;
+ /* Otherwise it depends on whether the old ban's text is a superset
+ * of the new. */
+ return mmatch(old_ban->banstr, new_ban->banstr);
}
/** Add a ban from a ban list and mark bans that should be removed