mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
pipewire: module-protocol-simple: fix inet_ntop() call
Previously, the buffer argument was a pointer which did not point to the address portion of an AF_INET address. See #2017
This commit is contained in:
parent
11db00abdf
commit
60818886ed
1 changed files with 2 additions and 2 deletions
|
|
@ -477,7 +477,7 @@ on_connect(void *data, int fd, uint32_t mask)
|
|||
{
|
||||
struct server *server = data;
|
||||
struct impl *impl = server->impl;
|
||||
struct sockaddr addr;
|
||||
struct sockaddr_in addr;
|
||||
socklen_t addrlen;
|
||||
int client_fd, val;
|
||||
struct client *client = NULL;
|
||||
|
|
@ -503,7 +503,7 @@ on_connect(void *data, int fd, uint32_t mask)
|
|||
spa_list_append(&server->client_list, &client->link);
|
||||
server->n_clients++;
|
||||
|
||||
if (inet_ntop(addr.sa_family, addr.sa_data, client->name, sizeof(client->name)) == NULL)
|
||||
if (inet_ntop(addr.sin_family, &addr.sin_addr.s_addr, client->name, sizeof(client->name)) == NULL)
|
||||
snprintf(client->name, sizeof(client->name), "client %d", client_fd);
|
||||
|
||||
client->source = pw_loop_add_io(impl->loop,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue