]> git.ipfire.org Git - thirdparty/curl.git/commit
connect: fix invalid "Network is unreachable" errors
authorAntonio Larrosa <larrosa@kde.org>
Thu, 5 May 2016 17:50:15 +0000 (19:50 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 8 May 2016 12:29:26 +0000 (14:29 +0200)
commitae8f6620726c51aaf69f92a846fae63e74c9fab2
tree1b23d433291e4fa23ddef4dceb18673ceaaa0793
parentbefa21f2cdefd3094a5ae407099d616d1f24fa4d
connect: fix invalid "Network is unreachable" errors

Sometimes, in systems with both ipv4 and ipv6 addresses but where the
network doesn't support ipv6, Curl_is_connected returns an error
(intermittently) even if the ipv4 socket connects successfully.

This happens because there's a for-loop that iterates on the sockets but
the error variable is not resetted when the ipv4 is checked and is ok.

This patch fixes this problem by setting error to 0 when checking the
second socket and not having a result yet.

Fixes #794
lib/connect.c