Bug#577456: nginx: Fix realoading with IPv6 addresses

Matthias-Christian Ott ott at mirix.org
Sun Apr 11 23:29:37 MSD 2010


Package: nginx
Version: 0.7.65-4
Severity: normal
Tags: patch

The function ngx_cmp_sockaddr contained a typo which prevented nginx
from reloading, because nginx tried to add a socket multiple times
to an epoll descriptor.

--- src/core/ngx_cycle.c~	2009-10-26 17:22:24.000000000 +0100
+++ src/core/ngx_cycle.c	2010-04-11 21:14:43.997932783 +0200
@@ -847,7 +847,7 @@
         sin61 = (struct sockaddr_in6 *) sa1;
         sin62 = (struct sockaddr_in6 *) sa2;
 
-        if (sin61->sin6_port != sin61->sin6_port) {
+        if (sin61->sin6_port != sin62->sin6_port) {
             return NGX_DECLINED;
         }

If nginx listened on an IPv6 address on multiple ports (e.g. [::]:80
and [::]:443), the port is ignored and thus a socket is added multiple
times, because the sockets are kept an a linked list and once a match
is found the list is not searched any further and the first socket
gets always selected and added via epoll_ctl.

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-3-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_DK.UTF-8, LC_CTYPE=en_DK.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages nginx depends on:
ii  libc6                   2.10.2-6         Embedded GNU C Library: Shared lib
ii  libgeoip1               1.4.6.dfsg-19    A non-DNS IP-to-country resolver l
ii  libpcre3                7.8-3            Perl 5 Compatible Regular Expressi
ii  libssl0.9.8             0.9.8n-1         SSL shared libraries
ii  lsb-base                3.2-23           Linux Standard Base 3.2 init scrip
ii  zlib1g                  1:1.2.3.4.dfsg-3 compression library - runtime

nginx recommends no packages.

nginx suggests no packages.

-- no debconf information





More information about the nginx-devel mailing list