From: Willy Tarreau Date: Tue, 19 Apr 2011 05:20:57 +0000 (+0200) Subject: [BUG] proto_tcp: fix address binding on remote source X-Git-Tag: v1.5-dev8~237 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=96dd079b49a4144516c0fdbbc11fbf4d37f39c3c;p=thirdparty%2Fhaproxy.git [BUG] proto_tcp: fix address binding on remote source Mark Brooks reported that commit 1b4b7c broke tproxy in 1.5-dev6. Nick Chalk tracked the issue down to a missing address family setting in tcp_bind_socket() which resulted in a failure to use get_addr_len(). This issue is 1.5-specific. --- diff --git a/src/proto_tcp.c b/src/proto_tcp.c index 13ea2103cb..e6d6c58a0a 100644 --- a/src/proto_tcp.c +++ b/src/proto_tcp.c @@ -132,6 +132,7 @@ int tcp_bind_socket(int fd, int flags, struct sockaddr_storage *local, struct so #endif if (flags) { memset(&bind_addr, 0, sizeof(bind_addr)); + bind_addr.ss_family = remote->ss_family; switch (remote->ss_family) { case AF_INET: if (flags & 1)