Committer  : entrope
CVSROOT    : /cvsroot/undernet-ircu
Module     : ircu2.10
Branch tags: u2_10_12_branch
Commit time: 2007-08-21 02:02:20 UTC

Modified files:
  Tag: u2_10_12_branch
     ircd/test/ircd_in_addr_t.c ircd/ircd_string.c ChangeLog

Log message:

Match 127.*.*.* masks against IPs in the usually expected manner.

---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.710.2.204 ircu2.10/ChangeLog:1.710.2.205
--- ircu2.10/ChangeLog:1.710.2.204      Mon Aug 20 18:13:15 2007
+++ ircu2.10/ChangeLog  Mon Aug 20 19:02:10 2007
@@ -1,5 +1,13 @@
 2007-08-20  Michael Poole <[EMAIL PROTECTED]>
 
+       * ircd/ircd_string.c (ircd_aton_ip4): Allow a sequence of *.* at
+       the end of an IPv4 mask.
+       (ipmask_parse): Likewise for *:* at the end of IPv6 masks.
+
+       * ircd/test/ircd_in_addr_t.c (test_masks): Add tests for this.
+
+2007-08-20  Michael Poole <[EMAIL PROTECTED]>
+
        * ircd/s_user.c (register_user): Update inv_clients and opers
        counts.  Call client_set_privs() for local users.
        (set_nick_name): Do not call client_set_privs() for remote users.
Index: ircu2.10/ircd/ircd_string.c
diff -u ircu2.10/ircd/ircd_string.c:1.24.2.1 
ircu2.10/ircd/ircd_string.c:1.24.2.2
--- ircu2.10/ircd/ircd_string.c:1.24.2.1        Sun Jan 14 19:08:23 2007
+++ ircu2.10/ircd/ircd_string.c Mon Aug 20 19:02:10 2007
@@ -18,7 +18,7 @@
  */
 /** @file
  * @brief Implementation of string operations.
- * @version $Id: ircd_string.c,v 1.24.2.1 2007/01/15 03:08:23 entrope Exp $
+ * @version $Id: ircd_string.c,v 1.24.2.2 2007/08/21 02:02:10 entrope Exp $
  */
 #include "config.h"
 
@@ -486,7 +486,7 @@
     ip |= part << (24 - 8 * dots++);
     part = 0;
     if (input[pos] == '*') {
-      while (input[++pos] == '*') ;
+      while (input[++pos] == '*' || input[pos] == '.') ;
       if (input[pos] != '\0')
         return 0;
       if (pbits)
@@ -604,7 +604,7 @@
       *pbits = part;
       goto finish;
     case '*':
-      while (input[++pos] == '*') ;
+      while (input[++pos] == '*' || input[pos] == ':') ;
       if (input[pos] != '\0' || colon < 8)
         return 0;
       if (pbits)
Index: ircu2.10/ircd/test/ircd_in_addr_t.c
diff -u ircu2.10/ircd/test/ircd_in_addr_t.c:1.4 
ircu2.10/ircd/test/ircd_in_addr_t.c:1.4.2.1
--- ircu2.10/ircd/test/ircd_in_addr_t.c:1.4     Sun Sep 11 20:40:17 2005
+++ ircu2.10/ircd/test/ircd_in_addr_t.c Mon Aug 20 19:02:10 2007
@@ -111,6 +111,7 @@
     { "::10.0.0.0", {{ 0, 0, 0, 0, 0, 0, 0xa00, 0 }}, 1, 1, 128 },
     { "192.168/16", {{ 0, 0, 0, 0, 0, 0xffff, 0xc0a8, 0 }}, 1, 1, 112 },
     { "192.*", {{ 0, 0, 0, 0, 0, 0xffff, 0xc000, 0 }}, 1, 1, 104 },
+    { "192.*.*.*", {{ 0, 0, 0, 0, 0, 0xffff, 0xc000, 0 }}, 1, 1, 104 },
     { "192.*/8", {{ 0, 0, 0, 0, 0, 0, 0, 0 }}, 1, 0, 0 },
     { "192*", {{ 0, 0, 0, 0, 0, 0, 0, 0 }}, 1, 0, 0 },
     { "192.168.0.0/16", {{ 0, 0, 0, 0, 0, 0, 0, 0 }}, 0, 0, 0 },
@@ -120,6 +121,7 @@
     { "a:b", {{ 0, 0, 0, 0, 0, 0, 0, 0 }}, 1, 0, 0 },
     { "a::*", {{ 0, 0, 0, 0, 0, 0, 0, 0 }}, 1, 0, 0 },
     { "a:*", {{ 0xa, 0, 0, 0, 0, 0, 0, 0 }}, 1, 1, 16 },
+    { "a:*:*", {{ 0xa, 0, 0, 0, 0, 0, 0, 0 }}, 1, 1, 16 },
     { "a:/16", {{ 0xa, 0, 0, 0, 0, 0, 0, 0 }}, 1, 1, 16 },
     { 0 }
 };
----------------------- End of diff -----------------------
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches

Reply via email to