Bug 230382 - www/thttpd REAL_IP patch is IPv4-only
Summary: www/thttpd REAL_IP patch is IPv4-only
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Alexey Dokuchaev
Depends on:
Blocks: 232348
  Show dependency treegraph
Reported: 2018-08-05 16:07 UTC by Bjoern A. Zeeb
Modified: 2018-10-17 08:32 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Bjoern A. Zeeb freebsd_committer 2018-08-05 16:07:04 UTC
In ports r377229 the thttps REAL_IP patch was added based on something from NginX if I understand the dead link reference correctly.  That cripples IPv6 ready software to IPv4 only.  Here's an entirely untested change to the diff you might want to apply:

                { // Use real IP if available
                cp = &buf[16];
                cp += strspn( cp, " \t" );
-               inet_aton( cp, &(hc->client_addr.sa_in.sin_addr) );
+#ifdef USE_IPV6
+               if (strchr(cp, '.') == NULL)
+                       inet_pton(AF_INET6, cp,
+                           &(hc->client_addr.sa_in6.sin6_addr) );
+               else
+                       inet_aton( cp, &(hc->client_addr.sa_in.sin_addr) );