This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author lepaperwan
Recipients Michael.Felt, asvetlov, eamanu, lepaperwan, maxifree, miss-islington, twisteroid ambassador, yselivanov
Date 2019-05-30.08:27:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1559204845.28.0.677551550717.issue35545@roundup.psfhosted.org>
In-reply-to
Content
Assuming similar configuration to the one in msg343430, a simple native getaddrinfo test to check whether any scope ID is returned.

```
#include <arpa/inet.h>
#include <sys/socket.h>
#include <netdb.h>
#include <stdio.h>


void test(char *addrstr) {
    int status;
    struct addrinfo *res;
    struct addrinfo *iter;
    struct sockaddr_in6 *addr;

    status = getaddrinfo(addrstr, "80", NULL, &res);
    if (status != 0) {
        fprintf(stderr, "getaddrinfo(%s) returned %i\n", addrstr, status);

        return;
    }

    for (iter = res; iter; iter = iter->ai_next) {
        if (iter->ai_addr->sa_family != AF_INET6)
            continue;

        addr = (struct sockaddr_in6 *) iter->ai_addr;
        if (addr->sin6_scope_id != 0) {
            fprintf(stdout, "getaddrinfo(%s) return scope %u\n", addrstr, addr->sin6_scope_id);

            return;
        }
    }
}

int main() {
    test("fe80::f8d1:81ff:fe81:ac05%2");
    test("fe80::f8d1:81ff:fe81:ac05%en1");

    return 0;
}
```

I've explicitly tested against numeric and named interfaces to ensure that this isn't linked to AIX only handling named interfaces for scopes instead of numeric ones (although given your `netstat` output, that's be surprising).

Since I've had to look for AIX programming documentation just to be sure, I also stumbled upon this AIX bug https://www-01.ibm.com/support/docview.wss?uid=isg1IV53671 (which is referenced by the one I mentioned previously but I missed that). It seem to apply up to 7100-03 so you should be immune nonetheless.

I also noticed that it mentions SSH not working so I went and checked the OpenSSH sources to see how they handle AIX.
While they have an explicit BROKEN_GETADDRINFO define, it doesn't check for the specific scoped IPv6 address issue so I'm not sure they decided to special case it.
https://github.com/openssh/openssh-portable/blob/85ceb0e64bff672558fc87958cd548f135c83cdd/configure.ac#L2341

If this is truly an "idiosyncrasy" in AIX, I'm not sure there is a better way to handle it than skipping it since it's not really a Python bug if the underlying `libc` doesn't work as intended.
History
Date User Action Args
2019-05-30 08:27:25lepaperwansetrecipients: + lepaperwan, asvetlov, yselivanov, Michael.Felt, eamanu, twisteroid ambassador, miss-islington, maxifree
2019-05-30 08:27:25lepaperwansetmessageid: <1559204845.28.0.677551550717.issue35545@roundup.psfhosted.org>
2019-05-30 08:27:25lepaperwanlinkissue35545 messages
2019-05-30 08:27:24lepaperwancreate