Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
multiprotocol (v4 and v6) retry logic seems odd #4954
I did this
i told libcurl to connect to a dual-homed (ipv4 and ipv6) web site during a time that i had no ipv6 default route, and the web site's ipv4 address was a black hole (SYN went out, nothing came back.)
I expected the following
i expected a timeout after the freebsd kernel's connect() syscall would have transmitted and retransmitted the SYN for about 30 seconds and then gave up.
what i got was a loop of repeated ipv6 no-such-route notifications from libcurl. see attachment.
curl 7.67.0 (amd64-portbld-freebsd12.0) libcurl/7.67.0 OpenSSL/1.1.1d zlib/1.2.11 nghttp2/1.40.0
FreeBSD fbsd.local 12.1-RELEASE-p2 FreeBSD 12.1-RELEASE-p2 GENERIC amd64
This puzzles me. curl should only try each address once as it iterates over the list of alternatives (with happy eyeballs). In your output it looks it gets stuck in a loop somehow trying the same IPv6 address over and over while it also waits for a response on the IPv4 connect attempt (that will never arrive).
Unfortunately I don't seem to have any good way to reproduce this case in my end so I've mostly been trying to read that output and compare to the source code...
That "Immediate connect fail" output comes from the
Any chance you can set a break-point in there somewhere and see if you can figure out where this goes wrong?