Hi , The top is Client(v6)----- (v6)haproxy(v6)----(v6)WWW Main config(ip6tables,ebtables,route) is almost the same as what we do with ipv4 . Some differenct is : 1. I use 2.6.39 kernel, and make USE_LINUX_TPROXY=1 USE_GETADDRINFO=1 USE_STATIC_PCRE=1 to build haproxy. 2. I appled the patch which allow bind nonlocal address with ipv6 3. I made a little change to haproxy(seems a bug?), the patch is attached.
But there is still some problem:
1. Client(v4)----- (v4)haproxy(v6)----(v6)WWW
Does not work if I extract client from HTTP headers.
2. ipv6 address parser in haproxy need to be improved, for example
source directive.
>From 70b6c77d0f8e669923e54e7b36334472f2a309d7 Mon Sep 17 00:00:00 2001
From: deltay <[email protected]>
Date: Mon, 20 Jun 2011 15:10:23 +0800
Subject: [PATCH] fix local address family when bind socket
---
src/proto_tcp.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/proto_tcp.c b/src/proto_tcp.c
index e6d6c58..f1639cf 100644
--- a/src/proto_tcp.c
+++ b/src/proto_tcp.c
@@ -148,7 +148,7 @@ int tcp_bind_socket(int fd, int flags, struct
sockaddr_storage *local, struct so
break;
}
}
-
+ bind_addr.ss_family = remote->ss_family;
setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char *) &one, sizeof(one));
if (foreign_ok) {
ret = bind(fd, (struct sockaddr *)&bind_addr,
get_addr_len(&bind_addr));
--
1.7.4.msysgit.0
2011/6/17 Willy Tarreau <[email protected]>:
> On Wed, Jun 15, 2011 at 10:23:39AM +0200, Brane F. Gra??nar wrote:
>> On Wednesday 15 of June 2011 09:12:00 Willy Tarreau wrote:
>> > The server address syntax is :
>> >
>> > server <name> <ip>:<port>
>> >
>> > So you should have a colon and not a space before '80' :
>> >
>> > 3ffe:ffff:21da:7:3c06:7c4c:8215:2:80
>> >
>> > Note that the syntax is non-ambiguous because the last colon is mandatory
>> > before the port, so anything which is before the last colon is the address
>>
>>
>> Willy, i have a suggestion; what if server declaration would be changed to:
>>
>> server [<ip_address>]:<port>
>> server [host.example.com]:port
>>
>> That would be new, "preferred" format, while "old" one would be supported,
>> but
>> deprecated.
>>
>> I think it would be trivial to implement and configuration would be much more
>> readable.
>>
>> The same with logs.
>>
>> What do you think?
>
> We could support both. There is no reason to have a different address
> format in servers and not on bind, source or dispatch lines. But on the
> other hand, I'd hate to have to use "[::]:80" on a bind line. The persons
> who proposed the use of the colon as the IPv6 address delimitor really did
> a mess, we don't need to make it even worse by making it mandatory to add
> brackets.
>
> Regards,
> Willy
>
>
0001-fix-local-address-family-when-bind-socket.patch
Description: Binary data

