From e862920a82997ef43430de3bacb97834401ab8ed Mon Sep 17 00:00:00 2001 From: Tobias Waldekranz Date: Tue, 28 Jan 2020 14:00:39 +0100 Subject: [PATCH] fix host consoles in combination --with-ipv6 With a non-blocking socket, connect(2) will set errno to EINPROGRESS and the user must then fetch the success/fail status from the socket. This was correctly handled in the IPv4 path, but not in the IPv6 path. Signed-off-by: Tobias Waldekranz --- conserver/consent.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/conserver/consent.c b/conserver/consent.c index 9447572..a936d9d 100644 --- a/conserver/consent.c +++ b/conserver/consent.c @@ -931,10 +931,11 @@ ConsInit(CONSENT *pCE) # endif if (!SetFlags(cofile, O_NONBLOCK, 0)) goto fail; - if ((ret = - connect(cofile, rp->ai_addr, - rp->ai_addrlen)) == 0) - goto success; + + ret = connect(cofile, rp->ai_addr, rp->ai_addrlen); + if (ret == 0 || errno == EINPROGRESS) + goto success; + fail: close(cofile); }