diff options
author | glx <glx@openttd.org> | 2009-04-03 16:22:34 +0000 |
---|---|---|
committer | glx <glx@openttd.org> | 2009-04-03 16:22:34 +0000 |
commit | 2dafb9dd577e49bbbe9572f9529a4abfa2f9b9bc (patch) | |
tree | f3676ea6f1d8aca74a480576657c8c8c14a7a40b | |
parent | e05e1822d61e8147889167896e97dd8687c10f69 (diff) | |
download | openttd-2dafb9dd577e49bbbe9572f9529a4abfa2f9b9bc.tar.xz |
(svn r15938) -Fix: broadcast addresses detection was broken for win32
-rw-r--r-- | src/network/core/host.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/network/core/host.cpp b/src/network/core/host.cpp index 5db3b2e79..88a662208 100644 --- a/src/network/core/host.cpp +++ b/src/network/core/host.cpp @@ -137,8 +137,10 @@ static int NetworkFindBroadcastIPsInternal(NetworkAddress *broadcast, int limit) sockaddr_storage address; memset(&address, 0, sizeof(address)); /* iiBroadcast is unusable, because it always seems to be set to 255.255.255.255. */ + memcpy(&address, &ifo[j].iiAddress.Address, sizeof(sockaddr)); ((sockaddr_in*)&address)->sin_addr.s_addr = ifo[j].iiAddress.AddressIn.sin_addr.s_addr | ~ifo[j].iiNetmask.AddressIn.sin_addr.s_addr; broadcast[index] = NetworkAddress(address, sizeof(sockaddr)); + index++; } closesocket(sock); |