Fix an IPcheck registry bug for IPv4 clients and a crash bug in /silence.
[ircu2.10.12-pk.git] / ircd / IPcheck.c
index af94d8cc50ba4a8484fdc778ff65ccfb87cfa32c..7c0b6aab4f06fb0ef290c825311aebda16dd5644 100644 (file)
@@ -120,8 +120,8 @@ static struct IPRegistryEntry* ip_registry_find(const struct irc_in_addr *ip)
   ip_registry_canonicalize(&canon, ip);
   entry = hashTable[ip_registry_hash(&canon)];
   for ( ; entry; entry = entry->next) {
-    int bits = (ip->in6_16[0] == ntohs(0x2002)) ? 48 : 64;
-    if (ipmask_check(ip, &entry->addr, bits))
+    int bits = (canon.in6_16[0] == htons(0x2002)) ? 48 : 64;
+    if (ipmask_check(&canon, &entry->addr, bits))
       break;
   }
   return entry;