summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorlinuxdaemon <linuxdaemon@users.noreply.github.com>2019-01-14 05:48:45 -0600
committerPeter Powell <petpow@saberuk.com>2019-01-14 11:48:45 +0000
commitf400d5f394a258dee58fb56420acd65e22503761 (patch)
treeeaf405f6da42adad8e92535e0f9b3b72b275ab3e /src/modules
parent0a7d2456d9e8b5a506e4619c40caef4606864502 (diff)
Redo OnSetEndPoint logic to fix duplicate clones (#1549).
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_cgiirc.cpp27
-rw-r--r--src/modules/m_haproxy.cpp3
2 files changed, 4 insertions, 26 deletions
diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp
index 4a5a4fb03..df8201bde 100644
--- a/src/modules/m_cgiirc.cpp
+++ b/src/modules/m_cgiirc.cpp
@@ -34,29 +34,6 @@ enum
RPL_WHOISGATEWAY = 350
};
-// We need this method up here so that it can be accessed from anywhere
-static void ChangeIP(LocalUser* user, const irc::sockets::sockaddrs& sa)
-{
- // Set the users IP address and make sure they are in the right clone pool.
- ServerInstance->Users->RemoveCloneCounts(user);
- user->SetClientIP(sa);
- ServerInstance->Users->AddClone(user);
- if (user->quitting)
- return;
-
- // Recheck the connect class.
- user->MyClass = NULL;
- user->SetClass();
- user->CheckClass();
- if (user->quitting)
- return;
-
- // Check if this user matches any XLines.
- user->CheckLines(true);
- if (user->quitting)
- return;
-}
-
// Encapsulates information about an ident host.
class IdentHost
{
@@ -215,7 +192,7 @@ class CommandWebIRC : public SplitCommand
// Set the IP address sent via WEBIRC. We ignore the hostname and lookup
// instead do our own DNS lookups because of unreliable gateways.
- ChangeIP(user, ipaddr);
+ user->SetClientIP(ipaddr);
return CMD_SUCCESS;
}
@@ -391,7 +368,7 @@ class ModuleCgiIRC
user->uuid.c_str(), user->GetIPString().c_str(), address.addr().c_str(), user->ident.c_str(), newident.c_str());
user->ChangeIdent(newident);
- ChangeIP(user, address);
+ user->SetClientIP(address);
break;
}
return MOD_RES_PASSTHRU;
diff --git a/src/modules/m_haproxy.cpp b/src/modules/m_haproxy.cpp
index f61a39fdd..ee9079cbf 100644
--- a/src/modules/m_haproxy.cpp
+++ b/src/modules/m_haproxy.cpp
@@ -261,7 +261,8 @@ class HAProxyHook : public IOHookMiddle
break;
}
- sock->OnSetEndPoint(server, client);
+ if (!sock->OnSetEndPoint(server, client))
+ return -1;
// Parse any available TLVs.
while (tlv_index < address_length)