Project

General

Profile

Actions

Bug #2832

closed

Build error on systems without IPV6 support (regression from 1.4.46)

Added by nicorac about 7 years ago. Updated about 7 years ago.

Status:
Fixed
Priority:
Low
Category:
core
Target version:
ASK QUESTIONS IN Forums:

Description

I've configured 1.4.47 with option --disable-ipv6 (my embedded system doesn't have it).
During build I have this error:

/src/lighttpd-1.4.47/src/network.c: In function ‘network_host_normalize_addr_str’:
/src/lighttpd-1.4.47/src/network.c:82:23: error: ‘sock_addr’ has no member named ‘ipv6’
Makefile:2346: recipe for target 'lighttpd-network.o' failed

Looking at network.c I see a new function, added with commit 3549fc828005cd5ef5110f44f17b9ff0f5665bb9:

static void network_host_normalize_addr_str(buffer *host, sock_addr *addr)

The offending code is at line 80:
unsigned short port = (addr->plain.sa_family == AF_INET)
  ? ntohs(addr->ipv4.sin_port)
  : ntohs(addr->ipv6.sin6_port);

sock_addr struct (in base.h) doesn't contain the ->ipv6 element when --disable-ipv6 option is used.

I've patched it like this (I really want to avoid IPV6 stuff...):

#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);
    }

Don't know if it's better to patch base.h instead...


Related issues 1 (0 open1 closed)

Has duplicate Bug #2834: lighttpd 1.4.47 doesn't compile with --disable-ipv6Duplicate2017-10-26Actions
Actions #1

Updated by gstrauss about 7 years ago

  • Status changed from New to Patch Pending
  • Priority changed from Normal to Low
  • Target version changed from 1.4.x to 1.4.48

Thanks. Easy to patch.

Actions #2

Updated by nicorac about 7 years ago

gstrauss wrote:

Thanks. Easy to patch.

Easier with this PR on GitHub ;)
https://github.com/lighttpd/lighttpd1.4/pull/87

Actions #3

Updated by nicorac about 7 years ago

  • Status changed from Patch Pending to Fixed
  • % Done changed from 0 to 100
Actions #4

Updated by stbuehler about 7 years ago

  • Has duplicate Bug #2834: lighttpd 1.4.47 doesn't compile with --disable-ipv6 added
Actions

Also available in: Atom