• IPv6-only testing

    From Julien Puydt@21:1/5 to All on Fri Feb 4 12:40:01 2022
    Hi,

    I got an RC bug on python-anyio, because its testsuite fails when run
    on an IPv6-only host [1].

    I pushed the issue upstream, and upstream has a patch proposal [2].

    Now comes the question: how do I test this patch?

    Cheers,

    J.Puydt

    [1] https://bugs.debian.org/1004461
    [2] https://github.com/agronholm/anyio/issues/417

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jakub Wilk@21:1/5 to All on Fri Feb 4 15:40:02 2022
    * Julien Puydt <julien.puydt@gmail.com>, 2022-02-04, 12:34:
    I got an RC bug on python-anyio, because its testsuite fails when run
    on an IPv6-only host [1].

    I'm pretty sure "IPv6-only" means "the only non-loopback addresses this
    host has are IPv6", rather than "it doesn't have any IPv4, not even
    127.0.0.1."

    This project uses AI_ADDRCONFIG: "IPv4 addresses are returned […] if the local system has at least one IPv4 address configured, […] The loopback address is not considered for this case as valid as a configured
    address."

    Somewhat surprisingly, this means that getaddrinfo("127.0.0.1", ...) can
    fail even when the 127.0.0.1 address exists.

    To reproduce this, unshare the network ("unshare -c -r --keep-caps" or
    "sudo unshare -n") and run:

    $ ip link set lo up

    $ ip link add dum0 type dummy

    $ ip link set dum0 up

    $ ip -br addr
    lo UNKNOWN 127.0.0.1/8 ::1/128
    dum0 UNKNOWN fe80::50aa:f3ff:fe1a:e828/64

    $ python3 -c 'from socket import *; getaddrinfo("127.0.0.1", port=1, flags=AI_ADDRCONFIG)'
    Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/usr/lib/python3.9/socket.py", line 954, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno -9] Address family for hostname not supported

    --
    Jakub Wilk

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon McVittie@21:1/5 to Jakub Wilk on Fri Feb 4 16:30:01 2022
    On Fri, 04 Feb 2022 at 15:38:12 +0100, Jakub Wilk wrote:
    * Julien Puydt <julien.puydt@gmail.com>, 2022-02-04, 12:34:
    I got an RC bug on python-anyio, because its testsuite fails when run on
    an IPv6-only host [1].

    I'm pretty sure "IPv6-only" means "the only non-loopback addresses this host has are IPv6", rather than "it doesn't have any IPv4, not even 127.0.0.1."

    This project uses AI_ADDRCONFIG: "IPv4 addresses are returned […] if the local system has at least one IPv4 address configured, […] The loopback address is not considered for this case as valid as a configured address."

    Somewhat surprisingly, this means that getaddrinfo("127.0.0.1", ...) can
    fail even when the 127.0.0.1 address exists.

    See also: https://bugs.debian.org/952740, which I reported as a result
    of the equivalent bug being reported for dbus.

    smcv

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jakub Wilk@21:1/5 to All on Fri Feb 4 18:00:01 2022
    * Jakub Wilk <jwilk@jwilk.net>, 2022-02-04, 15:38:
    unshare -c -r --keep-caps

    Oops, I meant "unshare -n -r --keep-caps".

    $ python3 -c 'from socket import *; getaddrinfo("127.0.0.1", port=1, flags=AI_ADDRCONFIG)'

    Note that the above does not fail when only loopback is configured, so
    it seems to be something else than #952740.

    I haven't figured out what's exactly going on in #1004461, because the
    package FTBFS for me in a different way that I don't understand. :-/

    --
    Jakub Wilk

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)