]> git.ipfire.org Git - thirdparty/haproxy.git/commit
[BUG] stream_sock: use get_addr_len() instead of sizeof() on sockaddr_storage
authorWilly Tarreau <w@1wt.eu>
Tue, 5 Apr 2011 14:56:50 +0000 (16:56 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 5 Apr 2011 14:56:50 +0000 (16:56 +0200)
commit1b4b7ce6dda09e95905b801a0fa7db0e7fc175d8
treeaac425ece9eb50b3427618afaceb2a854eb4ff0f
parentb06ed2c6afd5728f7a0ebeb0b58c065b78685783
[BUG] stream_sock: use get_addr_len() instead of sizeof() on sockaddr_storage

John Helliwell reported a runtime issue on Solaris since 1.5-dev5. Traces
show that connect() returns EINVAL, which means the socket length is not
appropriate for the family. Solaris does not like being called with sizeof
and needs the address family's size on sockaddr_storage.

The fix consists in adding a get_addr_len() function which returns the
socket's address length based on its family. Tests show that this works
for both IPv4 and IPv6 addresses.
include/common/standard.h
src/checks.c
src/log.c
src/proto_tcp.c