- /* initialize the algorithm if it is not yet ready */
- if (base_entropy == 0)
- base_entropy = get_string_entropy(INITDATA);
+ if (strchr(outbuf, ':'))
+ {
+ ipv6 = 1;
+
+ /* Damn you IPv6...
+ * We count the number of colons so we can calculate how much
+ * of the host to cloak. This is because some hostmasks may not
+ * have as many octets as we'd like.
+ *
+ * We have to do this ahead of time because doing this during
+ * the actual cloaking would get ugly
+ */
+ for (tptr = outbuf; *tptr != '\0'; tptr++)
+ if (*tptr == ':')
+ totalcount++;
+ }
+ else if (!strchr(outbuf, '.'))
+ return;