]> PatchyGit - patchyircd.git/commitdiff
give a different hostname for localhost connections
authorEgor <egor@patchysicp.xyz>
Thu, 19 Oct 2023 09:15:34 +0000 (12:15 +0300)
committerEgor <egor@patchysicp.xyz>
Thu, 19 Oct 2023 09:15:34 +0000 (12:15 +0300)
irc.c

diff --git a/irc.c b/irc.c
index 0ccd815..17c367d 100644 (file)
--- a/irc.c
+++ b/irc.c
@@ -292,7 +292,7 @@ int processPacket(struct client_data *client, char *source, char *command, int a
                client->realname = mystrdup(args[3]);
                if (!client->realname)
                        abort();
-               client->hostname = mystrdup(hostname);
+               client->hostname = mystrdup(!strcmp(client->peername, "127.0.0.1") ? "localhost" : hostname);
                if (!client->hostname)
                        abort();
                // Send welcome