Add lighttpd patch: add support for IPv6 to mod_extforward. From Brad.

This commit is contained in:
sthen 2012-05-25 08:24:40 +00:00
parent 8d4a4bec38
commit ed727655fa
2 changed files with 25 additions and 2 deletions

View File

@ -1,11 +1,11 @@
# $OpenBSD: Makefile,v 1.98 2012/05/15 19:38:01 jasper Exp $
# $OpenBSD: Makefile,v 1.99 2012/05/25 08:24:40 sthen Exp $
SHARED_ONLY= Yes
COMMENT= secure, fast, compliant, and very flexible web-server
DISTNAME= lighttpd-1.4.30
REVISION= 4
REVISION= 5
CATEGORIES= www net
MASTER_SITES= http://download.lighttpd.net/lighttpd/releases-1.4.x/

View File

@ -0,0 +1,23 @@
$OpenBSD: patch-src_mod_extforward_c,v 1.3 2012/05/25 08:24:40 sthen Exp $
Add support for IPv6.
--- src/mod_extforward.c.orig Mon May 21 23:19:12 2012
+++ src/mod_extforward.c Mon May 21 23:20:53 2012
@@ -241,14 +241,14 @@ static array *extract_forward_array(buffer *pbuffer)
int in_str = 0;
for (base = pbuffer->ptr, curr = pbuffer->ptr; *curr; curr++) {
if (in_str) {
- if ((*curr > '9' || *curr < '0') && *curr != '.' && *curr != ':') {
+ if ((*curr > '9' || *curr < '0') && *curr != '.' && *curr != ':' && (*curr < 'a' || *curr > 'f') && (*curr < 'A' || *curr > 'F')) {
/* found an separator , insert value into result array */
put_string_into_array_len(result, base, curr - base);
/* change state to not in string */
in_str = 0;
}
} else {
- if (*curr >= '0' && *curr <= '9') {
+ if ((*curr >= '0' && *curr <= '9') || *curr == ':' || (*curr >= 'a' && *curr <= 'f') || (*curr >= 'A' && *curr <= 'F')) {
/* found leading char of an IP address, move base pointer and change state */
base = curr;
in_str = 1;