From b7de0d9fa6d7d44f78aad540fdae749e80773dea Mon Sep 17 00:00:00 2001 From: Attila Fidan Date: Sun, 2 Jun 2024 04:06:51 +0000 Subject: [PATCH] main: Use info.address_storage to compose client addr strings Otherwise, getpeername() will truncate IPv6 client addresses and any IPv6 clients the control client receives information about in the JSON response will have the second half of their addresses zeroed out. --- src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index 8f54184..2a6c363 100644 --- a/src/main.c +++ b/src/main.c @@ -645,9 +645,9 @@ static void compose_client_info(const struct wayvnc_client* client, struct ctl_server_client_info* info) { info->id = client->id; - socklen_t addrlen = sizeof(info->address); + socklen_t addrlen = sizeof(info->address_storage); nvnc_client_get_address(client->nvnc_client, - (struct sockaddr*)&info->address, &addrlen); + (struct sockaddr*)&info->address_storage, &addrlen); info->username = nvnc_client_get_auth_username(client->nvnc_client); info->seat = client->seat ? client->seat->name : NULL; }