link-local IPv6 addresses are rejected

Bug #1534215 reported by Valery Ushakov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nc6 (Ubuntu)
New
Undecided
Unassigned

Bug Description

getaddrinfo(3) refuses to resolve IPv6 addresses if hint flag AI_ADDRCONFIG is specified and when there are no IPv6 addresses other than link-local are configured. Unfortunately that happens even with AI_NUMERICHOST. This makes it impossible to use nc6 with IPv6 loopback or link-local addresses on such systems, e.g.

$ nc6 -n fe80::a00:27ff:fefd:3b2a%eth0 12345
nc6: forward host lookup failed for remote endpoint fe80::a00:27ff:fefd:3b2a%eth0: Address family for hostname not supported

The code to resolve addresses in network.c does

#ifdef HAVE_GETADDRINFO_AI_ADDRCONFIG
        hints.ai_flags |= AI_ADDRCONFIG;
#endif
        if (ca_is_flag_set(attrs, CA_NUMERIC_MODE))
                hints.ai_flags |= AI_NUMERICHOST;

this should be perhaps changed to the (untested):

        if (ca_is_flag_set(attrs, CA_NUMERIC_MODE))
                hints.ai_flags |= AI_NUMERICHOST;
#ifdef HAVE_GETADDRINFO_AI_ADDRCONFIG
        else
                hints.ai_flags |= AI_ADDRCONFIG;
#endif

so that AI_ADDRCONFIG is not specified when numeric host address is used.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.