summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-04-08 21:16:24 +0000
committerrubidium <rubidium@openttd.org>2009-04-08 21:16:24 +0000
commitc2dbc8270be5b423019ea64e68e6b212d713c123 (patch)
tree5ad0ed3c8dbb4ce59ed5353cfca3092c03af86d0 /src
parent0f0cc67d621fbddae1768013f91b16bd421666c8 (diff)
downloadopenttd-c2dbc8270be5b423019ea64e68e6b212d713c123.tar.xz
(svn r15991) -Fix: don't add 0.0.0.0/:: to the server list; you can't connect to them in any case
Diffstat (limited to 'src')
-rw-r--r--src/network/network_gamelist.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/network/network_gamelist.cpp b/src/network/network_gamelist.cpp
index fc08437f8..ee55976f6 100644
--- a/src/network/network_gamelist.cpp
+++ b/src/network/network_gamelist.cpp
@@ -65,7 +65,14 @@ static void NetworkGameListHandleDelayedInsert()
* @return a point to the newly added or already existing item */
NetworkGameList *NetworkGameListAddItem(NetworkAddress address)
{
- if (StrEmpty(address.GetHostname())) return NULL;
+ const char *hostname = address.GetHostname();
+
+ /* Do not query the 'any' address. */
+ if (StrEmpty(hostname) ||
+ strcmp(hostname, "0.0.0.0") == 0 ||
+ strcmp(hostname, "::") == 0) {
+ return NULL;
+ }
NetworkGameList *item, *prev_item;