summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-04-09 21:26:29 +0000
committerrubidium <rubidium@openttd.org>2009-04-09 21:26:29 +0000
commit8477e923868029226626b890a7c6ef10fe12fa9c (patch)
tree075b1ed2db794fd7454221e2384990bb417f6195 /src/network
parentb5da02ac1cd67037a3521971bffab492ba4b6e3f (diff)
downloadopenttd-8477e923868029226626b890a7c6ef10fe12fa9c.tar.xz
(svn r16004) -Fix (r16000): explicitly binding to an IPv4 socket would try to register an IPv6 address (only if it could ofcourse)
Diffstat (limited to 'src/network')
-rw-r--r--src/network/core/address.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/core/address.cpp b/src/network/core/address.cpp
index 9a4bf18fb..159c9cf11 100644
--- a/src/network/core/address.cpp
+++ b/src/network/core/address.cpp
@@ -181,7 +181,7 @@ SOCKET NetworkAddress::Resolve(int family, int socktype, int flags, SocketList *
/* Setting both hostname to NULL and port to 0 is not allowed.
* As port 0 means bind to any port, the other must mean that
* we want to bind to 'all' IPs. */
- if (this->address_length == 0 && this->GetPort() == 0) {
+ if (StrEmpty(this->hostname) && this->address_length == 0 && this->GetPort() == 0) {
strecpy(this->hostname, this->address.ss_family == AF_INET ? "0.0.0.0" : "::", lastof(this->hostname));
}