From 0131cdb03d790810445ae7a3d6947b0ab44ceeb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustaf=20Alh=C3=A4ll?= Date: Thu, 14 Dec 2023 16:30:04 +0100 Subject: [PATCH] Fix IPv6 bans being ignored when loading banlist --- src/netcode/commands.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/netcode/commands.c b/src/netcode/commands.c index 4b67198ba..e7d51437e 100644 --- a/src/netcode/commands.c +++ b/src/netcode/commands.c @@ -79,7 +79,7 @@ static void Ban_Clear(void) void Ban_Load_File(boolean warning) { FILE *f; - const char *address, *mask; + char *address, *mask; char buffer[MAX_WADPATH]; if (!I_ClearBans) @@ -100,6 +100,14 @@ void Ban_Load_File(boolean warning) { address = strtok(buffer, " \t\r\n"); mask = strtok(NULL, " \t\r\n"); + if (address[0] == '[') + { + size_t len; + address++; + len = strlen(address); + if (address[len-1] == ']') + address[len-1] = '\0'; + } I_SetBanAddress(address, mask);