summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_cloaking.cpp26
-rw-r--r--src/modules/m_spanningtree.cpp2
2 files changed, 17 insertions, 11 deletions
diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp
index cddf2778d..92ae1af6c 100644
--- a/src/modules/m_cloaking.cpp
+++ b/src/modules/m_cloaking.cpp
@@ -368,16 +368,22 @@ class ModuleCloaking : public Module
this->GenHash(dest->host,ra);
std::string b = "";
in_addr testaddr;
- if (!inet_aton(dest->host,&testaddr))
- {
- // if they have a hostname, make something appropriate
- b = prefix + "-" + std::string(ra) + a;
- }
- else
- {
- // else, they have an ip
- b = std::string(ra) + "." + prefix + ".cloak";
- }
+ std::string hostcloak = prefix + "-" + std::string(ra) + a;
+ /* Fix by brain - if the cloaked host is > the max length of a host (64 bytes
+ * according to the DNS RFC) then tough titty, they get cloaked as an IP.
+ * Their ISP shouldnt go to town on subdomains, or they shouldnt have a kiddie
+ * vhost.
+ */
+ if ((!inet_aton(dest->host,&testaddr)) && (hostcloak.length() < 64))
+ {
+ // if they have a hostname, make something appropriate
+ b = hostcloak;
+ }
+ else
+ {
+ // else, they have an ip
+ b = std::string(ra) + "." + prefix + ".cloak";
+ }
Srv->Log(DEBUG,"cloak: allocated "+b);
Srv->ChangeHost(dest,b);
}
diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp
index 660e40ae7..4830d715d 100644
--- a/src/modules/m_spanningtree.cpp
+++ b/src/modules/m_spanningtree.cpp
@@ -1200,7 +1200,7 @@ class TreeSocket : public InspSocket
const char* n = "";
if (x & UCMODE_OP)
- ; {
+ {
n = "@";
}
else if (x & UCMODE_HOP)