[Bug 271335] www/lighttpd: fix listening on IPv6 and IPv4 addresses

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 09 May 2023 19:57:37 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=271335

            Bug ID: 271335
           Summary: www/lighttpd: fix listening on IPv6 and IPv4 addresses
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: pkubaj@FreeBSD.org
          Reporter: rcm@rcm.sh
          Assignee: pkubaj@FreeBSD.org
             Flags: maintainer-feedback?(pkubaj@FreeBSD.org)

Created attachment 242082
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=242082&action=edit
www/lighttpd: fix listening on IPv6 addresses

getaddrinfo was changed recently to (re)introduce EAI_NODATA and EAI_ADDRFAMILY
error cases. These are non-standard error cases with differing semantics across
different libc implementations. BSD libc returns EAI_ADDRFAMILY as being
synonymous with the nsdispatch error case of similar name NS_ADDRFAMILY.
However, GNU libc uses EAI_ADDRFAMILY to report trying to resolve an IPv4
address with an IPv6 hint and vice-versa.

lighttpd abuses this error case by assuming each listen address is first an
IPv6 address, falling through to trying IPv4 on error. On systems that define
EAI_ADDRFAMILY, the return code is tested to be EAI_ADDRFAMILY before
attempting the IPv4 lookup. On platforms that don't define EAI_ADDRFAMILY, this
additional test is skipped.

This patch undefines EAI_ADDRFAMILY.

-- 
You are receiving this mail because:
You are the assignee for the bug.