summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2009-04-03 16:22:34 +0000
committerglx <glx@openttd.org>2009-04-03 16:22:34 +0000
commit2dafb9dd577e49bbbe9572f9529a4abfa2f9b9bc (patch)
treef3676ea6f1d8aca74a480576657c8c8c14a7a40b /src
parente05e1822d61e8147889167896e97dd8687c10f69 (diff)
downloadopenttd-2dafb9dd577e49bbbe9572f9529a4abfa2f9b9bc.tar.xz
(svn r15938) -Fix: broadcast addresses detection was broken for win32
Diffstat (limited to 'src')
-rw-r--r--src/network/core/host.cpp2
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);