1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

http client: Fix overwite of addrlen for connect if binding to iface

The addrlen argument to connect() was overwritten by the
lws_socket_bind() result, which is a port number.
Fixes https://github.com/warmcat/libwebsockets/issues/1817
This commit is contained in:
Christian Thießen 2020-01-10 02:05:15 +01:00 committed by Andy Green
parent 04ec3d6f73
commit 6555d4d51c

View file

@ -566,9 +566,9 @@ ads_known:
_WSI_TOKEN_CLIENT_IFACE);
if (iface && *iface) {
n = lws_socket_bind(wsi->vhost, wsi->desc.sockfd, 0,
m = lws_socket_bind(wsi->vhost, wsi->desc.sockfd, 0,
iface, wsi->ipv6);
if (n < 0)
if (m < 0)
goto try_next_result_fds;
}
}