From bd05cdf779932b65781e7604d0a41504ecdc2beb Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Thu, 6 Jan 2022 15:24:17 +0100 Subject: [PATCH] Don't do GeoIP lookups for remote users. These are already looked up and synced by the server the user is on, and this way the country will be consistently the same on all servers (and not BE on one, and NL on another, which would be confusing for the ban matching code, giving different results on each server). --- src/modules/geoip_base.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/modules/geoip_base.c b/src/modules/geoip_base.c index 3244e1f7c..d4236ce5b 100644 --- a/src/modules/geoip_base.c +++ b/src/modules/geoip_base.c @@ -122,7 +122,6 @@ MOD_INIT() HookAdd(modinfo->handle, HOOKTYPE_SERVER_HANDSHAKE_OUT, 0, geoip_base_handshake); HookAdd(modinfo->handle, HOOKTYPE_CONNECT_EXTINFO, 1, geoip_connect_extinfo); /* (prio: near-first) */ HookAdd(modinfo->handle, HOOKTYPE_PRE_LOCAL_CONNECT, 0,geoip_base_handshake); /* in case the IP changed in registration phase (WEBIRC, HTTP Forwarded) */ - HookAdd(modinfo->handle, HOOKTYPE_REMOTE_CONNECT, 0, geoip_base_handshake); /* remote user */ HookAdd(modinfo->handle, HOOKTYPE_WHOIS, 0, geoip_base_whois); CommandAdd(modinfo->handle, "GEOIP", cmd_geoip, MAXPARA, CMD_USER); @@ -229,12 +228,13 @@ void geoip_base_unserialize(const char *str, ModData *m) m->ptr = res; } -EVENT(geoip_base_set_existing_users_evt){ +EVENT(geoip_base_set_existing_users_evt) +{ Client *client; - list_for_each_entry(client, &client_list, client_node){ - if (!IsUser(client)) - continue; - geoip_base_handshake(client); + list_for_each_entry(client, &client_list, client_node) + { + if (MyUser(client)) + geoip_base_handshake(client); } }