all repos — mgba @ b4460b98e2c082d80e54c419650814f0ebf2d09d

mGBA Game Boy Advance Emulator

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

b4460b98e2c082d80e54c419650814f0ebf2d09d

parent

43e2751be12b45217387ac1b0876269d1ca41ee6

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

jump to
M CHANGESCHANGES

@@ -16,6 +16,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

@@ -109,7 +109,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)); } else { struct sockaddr_in6 bindInfo;

@@ -144,7 +144,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)); } else { struct sockaddr_in6 bindInfo;