Use the larger sockaddr_storage structure

This commit is contained in:
Vitaliy Filippov
2022-02-12 11:22:56 +03:00
parent 46d2bc100f
commit 7d79c58095
9 changed files with 27 additions and 27 deletions
+2 -2
View File
@@ -47,13 +47,13 @@ int main(int narg, char *args[])
{
int listen_fd = create_and_bind_socket("0.0.0.0", 11203, 128, NULL);
// Accept new connections
sockaddr addr;
sockaddr_storage addr;
socklen_t peer_addr_size = sizeof(addr);
int peer_fd;
while (1)
{
printf("stub_osd: waiting for 1 client\n");
peer_fd = accept(listen_fd, &addr, &peer_addr_size);
peer_fd = accept(listen_fd, (sockaddr*)&addr, &peer_addr_size);
if (peer_fd == -1)
{
if (errno == EAGAIN)