mirror of
https://github.com/haproxy/haproxy.git
synced 2026-05-28 04:12:17 -04:00
CONTRIB: tcploop: fix connect's address length
FreeBSD wants the address size to be correct, so let's pass the size of a sockaddr_in struct, not the sockaddr_storage.
This commit is contained in:
parent
bcd817e669
commit
24d41b9b4d
1 changed files with 1 additions and 1 deletions
|
|
@ -424,7 +424,7 @@ int tcp_connect(const struct sockaddr_storage *sa, const char *arg)
|
|||
if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)) == -1)
|
||||
goto fail;
|
||||
|
||||
if (connect(sock, (const struct sockaddr *)sa, sizeof(*sa)) < 0) {
|
||||
if (connect(sock, (const struct sockaddr *)sa, sizeof(struct sockaddr_in)) < 0) {
|
||||
if (errno != EINPROGRESS)
|
||||
goto fail;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue