Unit tests fail in IPv6-only environment
- https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=974836
- https://salsa.debian.org/debian/openconnect/-/commit/b0713249f475c540a11e9d9a57595bebe2097f75#8756c63497c8dc39f7773438edf53b220c773f67_25_27
From https://lists.debian.org/debian-devel/2020/07/msg00070.html :
This was quickly diagnosed to be a result of passing the AI_ADDRCONFIG
flag to getaddrinfo(3). Quoting from that manual page:
If hints.ai_flags includes the AI_ADDRCONFIG flag, then IPv4 addresses
are returned in the list pointed to by res only if the local system has
at least one IPv4 address configured, and IPv6 addresses are returned
only if the local system has at least one IPv6 address configured.
The loopback address is not considered for this case as valid as a
configured address. This flag is useful on, for example, IPv4-only
systems, to ensure that getaddrinfo() does not return IPv6 socket
addresses that would always fail in connect(2) or bind(2).
It looks like ocserv is only listening on [::]
and not the legacy 0.0.0.0
address.
As with the recent socat 1.8 failure, this means sockwrap doesn't intercept it, and then openconnect can't connect.
Perhaps this is a sockwrap bug; unless the IPV6_V6ONLY
sockopt is set, listening on [::]
should accept Legacy IP connections too, so sockwrap should still intercede.
But it's probably better just to switch all our testing from Legacy IP to IPv6. Given that it's all intercepted by sockwrap, we don't even need IPv6 to be working in the test systems; not even for loopback.
Tag @bluca @AdrianBunk
Edited by David Woodhouse