summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornicorac <claudio.nicora@gmail.com>2017-10-25 16:48:24 +0200
committerGlenn Strauss <gstrauss@gluelogic.com>2017-10-25 22:45:57 -0400
commit3d257ec3a9be4e93ae8ffc117015bd94630a15dc (patch)
tree68713dd40e407213382c8b6121afffd9282833e4
parent3faf04284729e0653f8994b018d651b10da524a3 (diff)
downloadlighttpd1.4-3d257ec3a9be4e93ae8ffc117015bd94630a15dc.tar.gz
lighttpd1.4-3d257ec3a9be4e93ae8ffc117015bd94630a15dc.zip
[core] fix build --disable-ipv6 (fixes #2832)
x-ref: "Build error on systems without IPV6 support (regression from 1.4.46)" https://redmine.lighttpd.net/issues/2832 github: closes #87
-rw-r--r--src/network.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/network.c b/src/network.c
index 95f5bf37..39ebfbf3 100644
--- a/src/network.c
+++ b/src/network.c
@@ -77,9 +77,13 @@ static void network_host_normalize_addr_str(buffer *host, sock_addr *addr) {
if (addr->plain.sa_family == AF_INET6)
buffer_append_string_len(host, CONST_STR_LEN("]"));
if (addr->plain.sa_family != AF_UNIX) {
+ #ifdef HAVE_IPV6
unsigned short port = (addr->plain.sa_family == AF_INET)
? ntohs(addr->ipv4.sin_port)
: ntohs(addr->ipv6.sin6_port);
+ #else
+ unsigned short port = ntohs(addr->ipv4.sin_port);
+ #endif
buffer_append_string_len(host, CONST_STR_LEN(":"));
buffer_append_int(host, (int)port);
}