summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-06-17 12:11:17 +0000
committertron <tron@openttd.org>2006-06-17 12:11:17 +0000
commit5db6c57bead97ee1c774d02c7a870d4f08c23ddf (patch)
treec79ba9ca9e046f4abb96994e7061153cf0d094db
parent50cfa9403dab548f9607c02739923f3fefeca093 (diff)
downloadopenttd-5db6c57bead97ee1c774d02c7a870d4f08c23ddf.tar.xz
(svn r5295) Handle a quirk in the Windows interface detection code and fix a typo in r5293 (thanks to Darkvater for testing)
-rw-r--r--network.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/network.c b/network.c
index 110de84ae..bfc5d806f 100644
--- a/network.c
+++ b/network.c
@@ -399,10 +399,16 @@ static void NetworkFindIPs(void)
return;
}
- // Now walk through all IPs and list them
+ i = 0;
for (j = 0; j < len / sizeof(*ifo); j++) {
+ if (ifo[j].iiFlags & IFF_LOOPBACK) continue;
if (!(ifo[j].iiFlags & IFF_BROADCAST)) continue;
- _broadcast_list[i++] = ifo[j].iiBroadcastAddress.AddressIn.sin_addr.s_addr;
+ /* iiBroadcast is unusable, because it always seems to be set to
+ * 255.255.255.255.
+ */
+ _broadcast_list[i++] =
+ ifo[j].iiAddress.AddressIn.sin_addr.s_addr |
+ ~ifo[j].iiNetmask.AddressIn.sin_addr.s_addr;
}
#else
ifconf.ifc_len = sizeof(buf);