DEV9: Sockets: Fix UDP FixedPort

This commit is contained in:
TheLastRar 2022-10-23 17:50:52 +01:00 committed by lightningterror
parent 0ee28f3433
commit 6ad98e2c70
1 changed files with 15 additions and 0 deletions

View File

@ -79,6 +79,21 @@ namespace Sessions
#elif defined(__POSIX__)
errno);
#endif
sockaddr_in endpoint{0};
endpoint.sin_family = AF_INET;
*(IP_Address*)&endpoint.sin_addr = adapterIP;
endpoint.sin_port = htons(parPort);
ret = bind(client, (const sockaddr*)&endpoint, sizeof(endpoint));
if (ret == SOCKET_ERROR)
Console.Error("DEV9: UDP: Failed to bind socket. Error: %d",
#ifdef _WIN32
WSAGetLastError());
#elif defined(__POSIX__)
errno);
#endif
}
IP_Payload* UDP_FixedPort::Recv()