Bug 46195 - ProxyPass fails with literal IPv6 address
Summary: ProxyPass fails with literal IPv6 address
Status: REOPENED
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_proxy (show other bugs)
Version: 2.2.8
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-12 05:19 UTC by Chris Hills
Modified: 2012-01-08 18:01 UTC (History)
2 users (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Hills 2008-11-12 05:19:48 UTC
When using ProxyPass with a URL containing a literal IPv6 address, for example 'ProxyPass /google/ http://[2001:4860:0:1001::68]/', the web server returns a 400 Bad Request.

A workaround is to add a dummy entry to /etc/hosts, for example, '2001:4860:0:1001::68 dummy-google-ipv6', and adding 'ProxyPass /google/ http://dummy-google-ipv6/' to the configuration.
Comment 1 Nick Kew 2010-02-12 08:08:50 UTC

*** This bug has been marked as a duplicate of bug 47177 ***
Comment 2 info 2010-11-17 13:46:56 UTC
When trying to configure the following (2.2.17 on Win Server 2008):
   ProxyPass / http://[::1]:8020/
   ProxyPassReverse / http://[::1]:8020/

it produces the following error:
[Wed Nov 17 07:34:51 2010] [error] [client 95.87.153.77] proxy: DNS lookup failure for: [::1]]:802 returned by /
Comment 3 Nick Kew 2010-11-17 14:54:37 UTC
Diagnosis for the record: apr_sockaddr_info_get is being passed flags of 0 in proxy_util.c at line 2134 of proxy_util.c (2.2.17).  Passing it APR_IPV6_ADDR_OK fixes it.

Don't have time right now to figure out whether this is a correct or a coincidental fix, and apply it.
Comment 4 Stefan Fritsch 2012-01-08 18:01:25 UTC
(In reply to comment #3)
> Diagnosis for the record: apr_sockaddr_info_get is being passed flags of 0 in
> proxy_util.c at line 2134 of proxy_util.c (2.2.17).  Passing it
> APR_IPV6_ADDR_OK fixes it.

It passes family APR_UNSPEC, i.e. APR_IPV6_ADDR_OK should only change which addresses are returned first, not if they are returned at all. If apr_sockaddr_info_get() doesn't return v6 addresses without APR_IPV6_ADDR_OK that would be a bug in apr.

On the other hand, apr passes AI_ADDRCONFIG to getaddrinfo() in this case, so glibc's rather broken algorithm for checking IPv6 support could also be at fault (at least on Linux).