diff options
author | Peter Powell <petpow@saberuk.com> | 2018-09-05 16:27:57 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2018-09-18 10:48:02 +0100 |
commit | 548def58600a5841792504bfdb117c1077482a0d (patch) | |
tree | bfe6fce15ee0835d657c7a67c8b5ca8667bf1006 /src | |
parent | 0218d3290312c516b9b4bc72ae8778935e986300 (diff) |
Fix gateway client hosts not being updated if DNS resolution fails.
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/m_cgiirc.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp index 482c6447c..13f1c1fb5 100644 --- a/src/modules/m_cgiirc.cpp +++ b/src/modules/m_cgiirc.cpp @@ -192,7 +192,13 @@ class ModuleCgiIRC : public Module static void ChangeIP(LocalUser* user, const std::string& newip) { ServerInstance->Users->RemoveCloneCounts(user); + const std::string oldip(user->GetIPString()); user->SetClientIP(newip.c_str()); + user->InvalidateCache(); + if (user->host == oldip) + user->host = user->GetIPString(); + if (user->dhost == oldip) + user->dhost = user->GetIPString(); ServerInstance->Users->AddLocalClone(user); ServerInstance->Users->AddGlobalClone(user); } |