summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 159c9cf11..541b4673b 100644
--- a/src/network/core/address.cpp
+++ b/src/network/core/address.cpp
@@ -14,7 +14,7 @@
const char *NetworkAddress::GetHostname()
{
- if (StrEmpty(this->hostname)) {
+ if (StrEmpty(this->hostname) && this->address.ss_family != AF_UNSPEC) {
assert(this->address_length != 0);
getnameinfo((struct sockaddr *)&this->address, this->address_length, this->hostname, sizeof(this->hostname), NULL, 0, NI_NUMERICHOST);
}