DEV9: Use reinterpret_cast for sockaddr

This is UB, but is required by the api
This commit is contained in:
TheLastRar 2024-04-15 12:08:48 +01:00 committed by lightningterror
parent f5de7da42f
commit fe4693f158
1 changed files with 2 additions and 2 deletions

View File

@ -168,7 +168,7 @@ namespace Sessions
endpoint.sin_family = AF_INET;
endpoint.sin_addr = std::bit_cast<in_addr>(adapterIP);
ret = bind(client, (const sockaddr*)&endpoint, sizeof(endpoint));
ret = bind(client, reinterpret_cast<const sockaddr*>(&endpoint), sizeof(endpoint));
if (ret != 0)
Console.Error("DEV9: UDP: Failed to bind socket. Error: %d",
@ -212,7 +212,7 @@ namespace Sessions
endpoint.sin_addr = std::bit_cast<in_addr>(destIP);
endpoint.sin_port = htons(destPort);
ret = connect(client, (const sockaddr*)&endpoint, sizeof(endpoint));
ret = connect(client, reinterpret_cast<const sockaddr*>(&endpoint), sizeof(endpoint));
if (ret != 0)
{