[PATCH] Added so_freebind and so_transparent to the listen directive

Maxim Dounin mdounin at mdounin.ru
Thu Mar 27 17:13:53 UTC 2014


On Thu, Mar 27, 2014 at 04:34:37PM +0100, Trygve Vea wrote:

> # HG changeset patch
> # User Trygve Vea <trygve.vea at redpill-linpro.com>
> # Date 1395933815 -3600
> #      Thu Mar 27 16:23:35 2014 +0100
> # Node ID 13e6a37c2f57443b0d5dd0abce8d9d4ab00e31e3
> # Parent  2411d4b5be2ca690a5a00a1d8ad96ff69a00317f
> Added so_freebind and so_transparent to the listen directive
> This solves a Linux/IPv6-specific problem.
> To be able to listen to an IPv6 address that is not yet available on the host,
> one need to use the IP_FREEBIND and IP_TRANSPARENT socket options.
> The use case in question is for a failover setup with several service-
> addresses in a IPv6-only environment.
> IPv4 has a sysctl available (ip_nonlocal_bind), which is not available for
> IPv6 - thus making these patches necessary.

Isn't bind on INADDR_ANY/IN6ADDR_ANY works for you?

It is expected to work fine and allows to accept connections on 
all addresses currently available on a host without any 
non-portable tricks.

Maxim Dounin

More information about the nginx-devel mailing list