Project

General

Profile

Bug #2832

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

Added by nicorac 4 months ago. Updated 4 months ago.

Status:
Fixed
Priority:
Low
Assignee:
-
Category:
core
Target version:
Start date:
2017-10-25
Due date:
% Done:

100%

Estimated time:
Missing in 1.5.x:

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

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

Associated revisions

Revision 3d257ec3 (diff)
Added by nicorac 4 months ago

[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

History

#1

Updated by gstrauss 4 months 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.

#2

Updated by nicorac 4 months ago

gstrauss wrote:

Thanks. Easy to patch.

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

#3

Updated by nicorac 4 months ago

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

Updated by stbuehler 4 months ago

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

Also available in: Atom