all repos — mgba @ d59ef1c66aa2d88ad91bdc60561ee66f4f26d889

mGBA Game Boy Advance Emulator

Util: Fix socket bind addresses
Jeffrey Pfau jeffrey@endrift.com
Wed, 27 Apr 2016 22:17:21 -0700
commit

d59ef1c66aa2d88ad91bdc60561ee66f4f26d889

parent

c03f9bcc039c7c3f10cfe6df28f63bacec22dbb9

2 files changed, 3 insertions(+), 2 deletions(-)

jump to
M CHANGESCHANGES

@@ -20,6 +20,7 @@ - GBA Serialize: Fix loading savegames from savestates

- All: Fix several file handle leaks - Util: Use closesocket on Windows - GBA Memory: Fix executing code from OBJ region of VRAM + - Util: Fix socket bind addresses Misc: - GBA: Slightly optimize GBAProcessEvents - Qt: Add preset for DualShock 4
M src/util/socket.hsrc/util/socket.h

@@ -139,7 +139,7 @@ struct sockaddr_in bindInfo;

memset(&bindInfo, 0, sizeof(bindInfo)); bindInfo.sin_family = AF_INET; 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)); #ifndef _3DS } else {

@@ -176,7 +176,7 @@ struct sockaddr_in bindInfo;

memset(&bindInfo, 0, sizeof(bindInfo)); bindInfo.sin_family = AF_INET; 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)); #ifndef _3DS } else {