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.
master
Attila Fidan 2024-06-02 04:06:51 +00:00 committed by Andri Yngvason
parent f970c5ceb7
commit b7de0d9fa6
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}