X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_cloaking.cpp;h=0aee306a341f798f66900c180839ce940d038f34;hb=e80a1296a096ff2c495b3cd2a3913d5e5f6ec450;hp=5a0fb910297b88fb5f0c18e13625ff0ea7753779;hpb=26cd5393c9308fabe73c41870f06f73a5b001cd7;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp index 5a0fb9102..0aee306a3 100644 --- a/src/modules/m_cloaking.cpp +++ b/src/modules/m_cloaking.cpp @@ -133,7 +133,7 @@ class ModuleCloaking : public Module throw ModuleException("Could not add new modes!"); ServerInstance->Modules->UseInterface("HashRequest"); - Extensible::Register(&cu.ext); + ServerInstance->Extensions.Register(&cu.ext); Implementation eventlist[] = { I_OnRehash, I_OnCheckBan, I_OnUserConnect }; ServerInstance->Modules->Attach(eventlist, this, 3); @@ -237,15 +237,15 @@ class ModuleCloaking : public Module char rv[50]; if (ip.sa.sa_family == AF_INET6) { - snprintf(rv, 50, "%02x%02x.%02x%02x.%02x%02x.IP", + snprintf(rv, 50, ".%02x%02x.%02x%02x.%02x%02x.IP", ip.in6.sin6_addr.s6_addr[4], ip.in6.sin6_addr.s6_addr[5], ip.in6.sin6_addr.s6_addr[2], ip.in6.sin6_addr.s6_addr[3], ip.in6.sin6_addr.s6_addr[0], ip.in6.sin6_addr.s6_addr[1]); } else { - const char* ip4 = (const char*)&ip.in4.sin_addr; - snprintf(rv, 50, "%d.%d.IP", ip4[1], ip4[0]); + const unsigned char* ip4 = (const unsigned char*)&ip.in4.sin_addr; + snprintf(rv, 50, ".%d.%d.IP", ip4[1], ip4[0]); } return rv; } @@ -471,12 +471,12 @@ class ModuleCloaking : public Module tail = LastTwoDomainParts(dest->host); if (tail.empty() || tail.length() > 50) tail = ReversePartialIP(dest->client_sa); - chost = prefix + SegmentCloak(dest->host, 1) + "." + tail; + chost = prefix + SegmentCloak(dest->host, 1) + tail; break; } case MODE_OPAQUE: default: - chost = SegmentIP(dest->client_sa); + chost = prefix + SegmentIP(dest->client_sa); } cu.ext.set(dest,chost); }