From d3b82b2f7f75f56c318830ad0cc0c6e3d3b4a7c6 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Sun, 25 Sep 2016 21:41:05 +0100 Subject: Invalidate the caches properly when User::SetClientIP is called. --- src/users.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/users.cpp') diff --git a/src/users.cpp b/src/users.cpp index 418f2c9aa..685ef9743 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -837,6 +837,7 @@ void LocalUser::FullConnect() void User::InvalidateCache() { /* Invalidate cache */ + cachedip.clear(); cached_fullhost.clear(); cached_hostip.clear(); cached_makehost.clear(); @@ -1001,8 +1002,7 @@ irc::sockets::cidr_mask User::GetCIDRMask() bool User::SetClientIP(const char* sip, bool recheck_eline) { - cachedip.clear(); - cached_hostip.clear(); + this->InvalidateCache(); return irc::sockets::aptosa(sip, 0, client_sa); } -- cgit v1.3.1-10-gc9f91 From c165759fbe0dc1c1632cd5369dd1550f28f45a3b Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Mon, 5 Dec 2016 11:37:08 +0100 Subject: Fix users receiving a QUIT with themselves as source when host cycling in certain cases The OnBuildNeighborList handler in m_auditorium can add the cycling user to the exceptions as an always send exception. To fix, remove the user from the exceptions before processing them. Reported by @genius3000 on IRC --- src/users.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/users.cpp') diff --git a/src/users.cpp b/src/users.cpp index 418f2c9aa..af0e15f65 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -1398,6 +1398,8 @@ void User::DoHostCycle(const std::string &quitline) FOREACH_MOD(I_OnBuildNeighborList,OnBuildNeighborList(this, include_c, exceptions)); + // Users shouldn't see themselves quitting when host cycling + exceptions.erase(this); for (std::map::iterator i = exceptions.begin(); i != exceptions.end(); ++i) { LocalUser* u = IS_LOCAL(i->first); -- cgit v1.3.1-10-gc9f91