httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Puneet Mohan <puneetmoh...@gmail.com>
Subject Re: Apache : IPv4 mapped address Issue
Date Tue, 01 Mar 2011 14:22:00 GMT
Hi Jeho,

I applied the patch available at "
http://mail-archives.apache.org/mod_mbox/httpd-dev/201002.mbox/%3Ca96c392f1002180232t4ab2873o13106fa4e2bee80a@mail.gmail.com%3E"
given by Nicolas Normand.

Well, after researching (or I should say playing) a bit in with apache
source code, I can say that proxy server could bind to the non-local IPv4
mapped address as long as the socket is AF_INET6.

The problem I am facing over here is, Apache is able to bind to an ipv6
socket and accepts ipv4 connections on it.
**********************************************************
   addr.sin6_family = AF_INET6;
   addr.sin6_port = htons(portnum);
   inet_pton(AF_INET6, "0::0", &addr.sin6_addr)
   bind(sd, (struct sockaddr*)&addr, sizeof(addr)) != 0 )
   listen(sd, 15) != 0 )
**********************************************************
Due to this, web traffic coming from the IPv4 client is converted to the
"IPv4 mapped address" traffic .

So,  when I bind it to the non-local IP prior to connect() to the origin
server the bind couldn't understand the IPv4 mapped address as the other
socket opened for server side is a AF_INET(I requested IPv4 address from the
client) and transparency fails.

Regards,
Puneet Mohan

This results in IPv4 mapped addresses in the access.log like
"::ffff:127.0.0.1

On Tue, Mar 1, 2011 at 4:23 PM, JeHo Park <linuxpark@gmail.com> wrote:

> Hello Puneet Mohan,
>
> 2011-03-01 오후 6:51, Puneet Mohan 쓴 글:
>
>
>> Hi Jeff Trawick,
>>
>> I am presently implementing transparency in Apache source code. So the
>> strange thing I noticed that while binding to a non-local IP prior to
>> connect (), the remote addr(i.e. the client_addr) it binds to is in the IPv4
>> mapped address whereas the socket descriptor created is IPv4 type only.
>>
>>  did you apply tproxy version2 to your apache proxy code ?
> if so, i wonder whether tproxy2 core can support IPv4 mapped IPv6 address
> or not
>
>
>
>  As a result of this I couldn’t able to bind to the non-local IP.
>>
>>
>> The work around I tried is manipulating the bits of IPv4 mapped address,
>> but I don’t feel it to be convincing.
>>
>>
>> Regards,
>>
>> Puneet Mohan
>>
>>
>

Mime
View raw message