Welcome! Log In Create A New Profile

Advanced

Is the 607418-ipv6-addresses.diff patch still needed?

Mark Alan
November 08, 2011 06:06AM
Hello,

The current version of the debianized Nginx code applies the
attached 607418-ipv6-addresses.diff patch.

Do you still see any need to apply this patch to the current
nginx_1.1.7 code?

Regards,

M.


######## 607418-ipv6-addresses.diff patch follows ########
Description: $host variable mis-parses IPv6 literal addresses from HTTP
Author: Steven Chamberlain <steven@pyro.eu.org>
Debian-Bug: http://bugs.debian.org/607418
Last-Update: 2010-12-30

Index: trunk/src/http/ngx_http_request.c
===================================================================
--- trunk.orig/src/http/ngx_http_request.c 2010-12-30
01:46:10.308926973 -0600 +++ trunk/src/http/ngx_http_request.c
2010-12-30 01:48:21.638927393 -0600 @@ -1650,11 +1650,12 @@
{
u_char *h, ch;
size_t i, last;
- ngx_uint_t dot;
+ ngx_uint_t dot, in_brackets;

last = len;
h = *host;
dot = 0;
+ in_brackets = 0;

for (i = 0; i < len; i++) {
ch = h[i];
@@ -1670,11 +1671,27 @@

dot = 0;

- if (ch == ':') {
+ if (ch == '[' && i == 0) {
+ /* start of literal IPv6 address */
+ in_brackets = 1;
+ continue;
+ }
+
+ /*
+ * Inside square brackets, the colon is a delimeter for an
IPv6 address.
+ * Otherwise it comes before the port number, so remove it.
+ */
+ if (ch == ':' && !in_brackets) {
last = i;
continue;
}

+ if (ch == ']') {
+ /* end of literal IPv6 address */
+ in_brackets = 0;
+ continue;
+ }
+
if (ngx_path_separator(ch) || ch == '\0') {
return 0;
}
@@ -1684,6 +1701,11 @@
}
}

+ if (in_brackets) {
+ /* missing the closing square bracket for IPv6 address */
+ return 0;
+ }
+
if (dot) {
last--;
}

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Is the 607418-ipv6-addresses.diff patch still needed?

Mark Alan November 08, 2011 06:06AM

Re: Is the 607418-ipv6-addresses.diff patch still needed?

Cyril LAVIER November 08, 2011 06:18AM

Re: Is the 607418-ipv6-addresses.diff patch still needed?

Cyril LAVIER November 08, 2011 06:26AM

Re: Is the 607418-ipv6-addresses.diff patch still needed?

Mark Alan November 08, 2011 06:54AM

Re: Is the 607418-ipv6-addresses.diff patch still needed?

Cyril LAVIER November 08, 2011 07:02AM

Re: Is the 607418-ipv6-addresses.diff patch still needed?

Jelle de Jong November 08, 2011 08:16AM

Re: Is the 607418-ipv6-addresses.diff patch still needed?

Maxim Dounin November 08, 2011 08:02AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 156
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready