1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-06-12 17:34:46 +02:00

set_client_ip() was not updating client->sockhost. That meant in WEBIRC

situations connect-flood may not be working (it used the webirc ip,
which is almost always exempt, instead of the spoofed IP).
This commit is contained in:
Bram Matthys
2026-05-05 09:48:19 +02:00
parent 665d01b7ea
commit 4adaddeee1
+11
View File
@@ -1645,6 +1645,17 @@ int set_client_ip(Client *client, const char *ip)
inetntop(af, client->rawip, newip, sizeof(newip));
safe_strdup(client->ip, newip);
/* We also keep sockhost in sync with the new IP. Otherwise some
* instances of match_user() in pre-reg may match against the old IP.
* Note that this also means we overwrite sockhost if it contained
* a hostname, that is good for e.g. WEBIRC case, since the IP is
* changed and the old hostname is from the WebIRC gateway.
* Fortunately all callers that set hostnames do so after calling
* set_client_ip(), so that is correct.
*/
if (client->local)
set_sockhost(client, client->ip);
/* For IP changes (so not first set), call this hook */
if (*oldip)
{