You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@apr.apache.org by bu...@apache.org on 2012/02/19 16:38:33 UTC

DO NOT REPLY [Bug 52709] New: Apache can't bind to 127.0.0.1 if eth0 as only IPv6

https://issues.apache.org/bugzilla/show_bug.cgi?id=52709

             Bug #: 52709
           Summary: Apache can't bind to 127.0.0.1 if eth0 as only IPv6
           Product: APR
           Version: 1.4.5
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: APR
        AssignedTo: bugs@apr.apache.org
        ReportedBy: jmv_deb@nirgal.com
    Classification: Unclassified


>From http://bugs.debian.org/500558

Apache can't bind to 127.0.0.1 if eth0 as only IPv6

I traced back that problem to a call in libapr1, in call_resolver()
getaddrinfo("127.0.0.1", NULL, &hints, ...) that returns -9
because hints contains AI_ADDRCONFIG

Without that hint, it works.

Extract from call_resolver:
    if (family == APR_UNSPEC) {
        /* By default, only look up addresses using address types for
         * which a local interface is configured, i.e. no IPv6 if no
         * IPv6 interfaces configured. */
        hints.ai_flags = AI_ADDRCONFIG;
    }

Aurelien Jarno pointed out that whatever what the documentation says, RFC3493
explicitly exclude the loopback addresses:

   If the AI_ADDRCONFIG flag is specified, IPv4 addresses shall be
   returned only if an IPv4 address is configured on the local system,
   and IPv6 addresses shall be returned only if an IPv6 address is
   configured on the local system.  The loopback address is not
   considered for this case as valid as a configured address.

This results in:
[Mon Sep 29 10:33:20 2008] [crit] (EAI 9)Address family for hostname not
supported: alloc_listener: failed to set up sockaddr for 127.0.0.1
Syntax error on line 1 of /etc/apache2/ports.conf:
Listen setup failed

I think cannot use AI_ADDRCONFIG if we are to allow localhost binding.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


[Bug 52709] Apache can't bind to 127.0.0.1 if eth0 has only IPv6

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52709

Stefan Fritsch <sf...@sfritsch.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Stefan Fritsch <sf...@sfritsch.de> ---
trunk: r1343233
1.5: r1343236
1.4: r1343239 (will be in 1.4.7)

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


[Bug 52709] Apache can't bind to 127.0.0.1 if eth0 has only IPv6

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52709

Jeff Trawick <tr...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |CLOSED

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 52709] Apache can't bind to 127.0.0.1 if eth0 has only IPv6

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52709

--- Comment #1 from Nirgal Vourgère <jm...@nirgal.com> 2012-02-21 18:05:33 UTC ---
Created attachment 28360
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=28360
Patch for loopback support in call_resolver() IPv6/IPv4 mismatch

It is a pity not to use AI_ADDRCONFIG hint for production servers not using
loopback.
So I used the existing retry mechanism designed for EAI_BADFLAGS.

Tested on version 1.4.2, but should apply to all recent ones.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 52709] Apache can't bind to 127.0.0.1 if eth0 has only IPv6

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52709

Nirgal Vourgère <jm...@nirgal.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |PatchAvailable

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 52709] Apache can't bind to 127.0.0.1 if eth0 has only IPv6

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52709

Nirgal Vourgère <jm...@nirgal.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Apache can't bind to        |Apache can't bind to
                   |127.0.0.1 if eth0 as only   |127.0.0.1 if eth0 has only
                   |IPv6                        |IPv6

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 52709] Apache can't bind to 127.0.0.1 if eth0 has only IPv6

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52709

--- Comment #2 from Nirgal Vourgère <jm...@nirgal.com> 2012-02-22 11:15:11 UTC ---
This bug also affects httpd function ap_get_local_host() as described in
http://bugs.debian.org/629899
Httpd will then fail to get the fully qualified domain name.

This occurs when apache starts before dhclient finished its job.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org