Allow both *!*@1.2.3.* and *!*@1.2.3.0/22 to be banned at the same time.
authorMichael Poole <mdpoole@troilus.org>
Tue, 4 Apr 2006 23:09:48 +0000 (23:09 +0000)
committerMichael Poole <mdpoole@troilus.org>
Tue, 4 Apr 2006 23:09:48 +0000 (23:09 +0000)
git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/branches/u2_10_12_branch@1635 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
ircd/channel.c

index 826e98e76ed62e96a866ba86f069eb15b0d40c2a..bf9d9b87a9b1971a80aee6b33f779f931ee54b1c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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
index b97b89a1d57b110b777dbe3ede4169e12535070e..d7e3145845d957b00d56e02cf603871dd49d7822 100644 (file)
@@ -2685,8 +2685,12 @@ bmatch(struct Ban *old_ban, struct Ban *new_ban)
   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