ircd_string.c: Support abcd* in ipmask_parse().
[ircu2.10.12-pk.git] / ircd / ircd_string.c
index b5b32cfc01dacc068e56e674910c6043322d6c4e..7785d58c60d57d9bccab5230b2f7c1040caf2950 100644 (file)
@@ -609,6 +609,8 @@ ipmask_parse(const char *input, struct irc_in_addr *ip, unsigned char *pbits)
       while (input[++pos] == '*' || input[pos] == ':') ;
       if (input[pos] != '\0' || colon < 8)
         return 0;
+      if (part && ii < 8)
+          ip->in6_16[ii++] = htons(part);
       if (pbits)
         *pbits = ii * 16;
       return pos;
@@ -622,6 +624,8 @@ ipmask_parse(const char *input, struct irc_in_addr *ip, unsigned char *pbits)
     default:
       return 0;
     }
+    if (input[pos] != '\0')
+      return 0;
   finish:
     if (colon < 8) {
       unsigned int jj;