svn commit: r525787 - in head/www/thttpd: . files
Alexey Dokuchaev
danfe at FreeBSD.org
Tue Feb 11 07:07:14 UTC 2020
Author: danfe
Date: Tue Feb 11 07:07:14 2020
New Revision: 525787
URL: https://svnweb.freebsd.org/changeset/ports/525787
Log:
In r377229, the REAL_IP patch from NginX was added that puts X-Forwarded-For
into Remote-Addr. That cripples IPv6 ready software to IPv4 only, let's try
to fix this.
PR: 230382
Submitted by: bz
Modified:
head/www/thttpd/Makefile
head/www/thttpd/files/extra-patch-ip_real
Modified: head/www/thttpd/Makefile
==============================================================================
--- head/www/thttpd/Makefile Tue Feb 11 06:23:11 2020 (r525786)
+++ head/www/thttpd/Makefile Tue Feb 11 07:07:14 2020 (r525787)
@@ -3,6 +3,7 @@
PORTNAME= thttpd
PORTVERSION= 2.29
+PORTREVISION= 1
CATEGORIES= www
MASTER_SITES= http://www.acme.com/software/thttpd/
Modified: head/www/thttpd/files/extra-patch-ip_real
==============================================================================
--- head/www/thttpd/files/extra-patch-ip_real Tue Feb 11 06:23:11 2020 (r525786)
+++ head/www/thttpd/files/extra-patch-ip_real Tue Feb 11 07:07:14 2020 (r525787)
@@ -1,6 +1,6 @@
--- libhttpd.c.orig 2003-12-25 20:06:05.000000000 +0100
+++ libhttpd.c 2005-01-09 00:26:04.867255248 +0100
-@@ -2207,6 +2207,12 @@
+@@ -2207,6 +2207,18 @@
if ( strcasecmp( cp, "keep-alive" ) == 0 )
hc->keep_alive = 1;
}
@@ -8,6 +8,12 @@
+ { // Use real IP if available
+ cp = &buf[16];
+ cp += strspn( cp, " \t" );
++#ifdef USE_IPV6
++ if (strchr(cp, '.') == NULL)
++ inet_pton( AF_INET6, cp,
++ &(hc->client_addr.sa_in6.sin6_addr) );
++ else
++#endif
+ inet_aton( cp, &(hc->client_addr.sa_in.sin_addr) );
+ }
#ifdef LOG_UNKNOWN_HEADERS
More information about the svn-ports-all
mailing list