nginx reloading not working with IPv6 enabled

Bug #902223 reported by Alessio Caiazza
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
nginx (Ubuntu)
Fix Released
Undecided
Unassigned
Lucid
Fix Released
Undecided
Unassigned

Bug Description

I've an ubuntu 10.04.3 server that can't reload nginix configuration due to the following bug.

From: http://mailman.nginx.org/pipermail/nginx-devel/2010-April/000176.html

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.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in nginx (Ubuntu):
status: New → Confirmed
Revision history for this message
tommyblue (tommaso-visconti) wrote :

I've the same issue.
The real problem is that the reload freezes nginx completely without any bad message!

Revision history for this message
Michele Bursi (ironmiky) wrote :

Same issue for me!

Changed in nginx (Ubuntu Lucid):
status: New → In Progress
assignee: nobody → Mahyuddin Susanto (udienz)
Changed in nginx (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Mahyuddin Susanto (udienz) wrote :

Uploading to lucid-proposed, subscribing ubuntu-sru

Changed in nginx (Ubuntu Lucid):
status: In Progress → Fix Committed
Changed in nginx (Ubuntu Lucid):
assignee: Mahyuddin Susanto (udienz) → nobody
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Hello Alessio, or anyone else affected,

Accepted nginx into lucid-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

tags: added: verification-needed
Revision history for this message
Alessio Caiazza (nolith) wrote :

I've installed it and tried to reload the configuration without any problem.

Now it's runing on my production server.

Thank you

Martin Pitt (pitti)
tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package nginx - 0.7.65-1ubuntu2.2

---------------
nginx (0.7.65-1ubuntu2.2) lucid-proposed; urgency=low

  * debian/patches/LP-902223.patch: Patch to fix reloading
    IPv6 addresses, patch derived from Debian. (LP: #902223)
 -- Mahyuddin Susanto <email address hidden> Thu, 12 Jan 2012 14:45:20 +0700

Changed in nginx (Ubuntu Lucid):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.