Fix previous commit and parsing of ipmasks like 127/8.
authorMichael Poole <mdpoole@troilus.org>
Mon, 12 Sep 2005 16:11:58 +0000 (16:11 +0000)
committerMichael Poole <mdpoole@troilus.org>
Mon, 12 Sep 2005 16:11:58 +0000 (16:11 +0000)
git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1480 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
RELEASE.NOTES
ircd/ircd_string.c
ircd/m_join.c

index f25f86bb931a7de78586489ea3b27c58c8c1b4aa..50694df5a3fa4c8a615d22f03d250f3ce28b0499 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-09-12  Michael Poole <mdpoole@troilus.org>
+
+       * RELEASE.NOTES: Note the resolution of ambiguous ipmasks.
+
+       * ircd/ircd_string.c (ipmask_parse): Implement it.
+
 2005-09-12  Michael Poole <mdpoole@troilus.org>
 
        * ircd/m_join.c (m_join): If we find an empty key, null out the
index bde760c11e15794faae4c7ff4ceca381084c1aee..199d855620a2c5601c30c32386f33de62365b269 100644 (file)
@@ -87,7 +87,8 @@ both sides of the net join have the same key.
 
 IP masks (as used in bans, G-lines, etc) are now parsed in a more
 forgiving manner.  127.0.0.0/8, 127.* and 127/8 are all accepted and
-mean the same thing.
+mean the same thing.  Ambiguous expressions like 127/8 are interpreted
+as IPv4 masks; to interpret it as an IPv6 mask, use 127:/8.
 
 Configuration Changes:
 
index bfdceb5aac22c8bec4f660bab9e5c5865621fcc5..52caed58499033be7ec450e3716fa186446a5e21 100644 (file)
@@ -628,7 +628,7 @@ ipmask_parse(const char *input, struct irc_in_addr *ip, unsigned char *pbits)
         ip->in6_16[colon + jj] = 0;
     }
     return pos;
-  } else if (dot) {
+  } else if (dot || strchr(input, '/')) {
     unsigned int addr;
     int len = ircd_aton_ip4(input, &addr, pbits);
     if (len) {
index ad412956a64285c8e3aeb61e62511994fb336b09..f230beb07219d0c0656ff97de23e373dd2c81fc8 100644 (file)
@@ -132,7 +132,7 @@ int m_join(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
       *keys++ = '\0';
 
     /* Empty keys are the same as no keys. */
-    if (!key[0])
+    if (key && !key[0])
       key = 0;
 
     clean_channelname(name);