Util: Fix socket bind addresses

This commit is contained in:
Jeffrey Pfau 2016-04-27 22:17:21 -07:00
parent c03f9bcc03
commit d59ef1c66a
2 changed files with 3 additions and 2 deletions

View File

@ -20,6 +20,7 @@ Bugfixes:
- All: Fix several file handle leaks - All: Fix several file handle leaks
- Util: Use closesocket on Windows - Util: Use closesocket on Windows
- GBA Memory: Fix executing code from OBJ region of VRAM - GBA Memory: Fix executing code from OBJ region of VRAM
- Util: Fix socket bind addresses
Misc: Misc:
- GBA: Slightly optimize GBAProcessEvents - GBA: Slightly optimize GBAProcessEvents
- Qt: Add preset for DualShock 4 - Qt: Add preset for DualShock 4

View File

@ -139,7 +139,7 @@ static inline Socket SocketOpenTCP(int port, const struct Address* bindAddress)
memset(&bindInfo, 0, sizeof(bindInfo)); memset(&bindInfo, 0, sizeof(bindInfo));
bindInfo.sin_family = AF_INET; bindInfo.sin_family = AF_INET;
bindInfo.sin_port = htons(port); bindInfo.sin_port = htons(port);
bindInfo.sin_addr.s_addr = bindAddress->ipv4; bindInfo.sin_addr.s_addr = htonl(bindAddress->ipv4);
err = bind(sock, (const struct sockaddr*) &bindInfo, sizeof(bindInfo)); err = bind(sock, (const struct sockaddr*) &bindInfo, sizeof(bindInfo));
#ifndef _3DS #ifndef _3DS
} else { } else {
@ -176,7 +176,7 @@ static inline Socket SocketConnectTCP(int port, const struct Address* destinatio
memset(&bindInfo, 0, sizeof(bindInfo)); memset(&bindInfo, 0, sizeof(bindInfo));
bindInfo.sin_family = AF_INET; bindInfo.sin_family = AF_INET;
bindInfo.sin_port = htons(port); bindInfo.sin_port = htons(port);
bindInfo.sin_addr.s_addr = destinationAddress->ipv4; bindInfo.sin_addr.s_addr = htonl(destinationAddress->ipv4);
err = connect(sock, (const struct sockaddr*) &bindInfo, sizeof(bindInfo)); err = connect(sock, (const struct sockaddr*) &bindInfo, sizeof(bindInfo));
#ifndef _3DS #ifndef _3DS
} else { } else {