mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 22:01:31 +02: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
@ -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…
x
Reference in New Issue
Block a user