[Bug 5042] busybox fails to connect to IPv6-and-V4 targets from v4-only hosts

bugzilla at busybox.net bugzilla at busybox.net
Wed Jan 16 01:47:05 UTC 2013


https://bugs.busybox.net/show_bug.cgi?id=5042

--- Comment #5 from Denys Vlasenko <vda.linux at googlemail.com> 2013-01-16 01:47:27 UTC ---
(In reply to comment #4)
> (In reply to comment #3)
> > Did you try to ENABLE_FEATURE_PREFER_IPV4_ADDRESS in .config?
> 
> Yes, CONFIG_FEATURE_PREFER_IPV4_ADDRESS=y has always been set.

Then it has to use IPv4 in the situation described in 1st comment:

"Apparently when getaddrinfo() returns a v6 addresss before v4 one, and the
host
from which we're trying to connect does not have v6 routing, the connection
fails.
As far as I can see, this is due to str2sockaddr() function returning only
first address..."

Relevant code from busybox-1.19.4/libbb/xconnect.c:

str2sockaddr(...) {
...
        rc = getaddrinfo(host, NULL, &hint, &result);
        if (rc || !result) {
                ...error...
        }
        used_res = result;
#if ENABLE_FEATURE_PREFER_IPV4_ADDRESS
        while (1) {
                if (used_res->ai_family == AF_INET)
                        break;
                used_res = used_res->ai_next;
                if (!used_res) {
                        used_res = result;
                        break;
                }
        }
#endif

Can you debug why it doesn't work as intended?

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the busybox-cvs mailing list