[all-commits] [llvm/llvm-project] 18e96a: [lldb/unittests] Skip IPv6 test on systems which d...
Pavel Labath via All-commits
all-commits at lists.llvm.org
Mon Apr 27 08:33:44 PDT 2020
Branch: refs/heads/master
Home: https://github.com/llvm/llvm-project
Commit: 18e96a31fe0214eb435e131e6ff585a899694576
https://github.com/llvm/llvm-project/commit/18e96a31fe0214eb435e131e6ff585a899694576
Author: Pavel Labath <pavel at labath.sk>
Date: 2020-04-27 (Mon, 27 Apr 2020)
Changed paths:
M lldb/source/Host/common/TCPSocket.cpp
M lldb/unittests/Host/ConnectionFileDescriptorTest.cpp
M lldb/unittests/Host/SocketTest.cpp
M lldb/unittests/Host/SocketTestUtilities.cpp
M lldb/unittests/Host/SocketTestUtilities.h
Log Message:
-----------
[lldb/unittests] Skip IPv6 test on systems which don't have IPv6 configured
Sadly IPv6 is still not present anywhere. The test was attempting to
detect&skip such hosts, but the way it did that (essentially, by calling
getaddrinfo) meant that it only detected hosts which have IPv6 support
completely compiled out. It did not do anything about hosts which have
it compiled in, but lack runtime configuration even for the ::1 loopback
address.
This patch changes the detection logic to use a new method. It does it
by attempting to bind a socket to the appropriate loopback address. That
should ensure the hosts loopback interface is fully set up. In an effort
to avoid silently skipping the test on too many hosts, the test is
fairly strict about the kind of error it expects in these cases -- it
will only skip the test when receiving EADDRNOTAVAIL. If we find other
error codes that can be reasonably returned in these situations, we can
add more of them.
The (small) change in TCPSocket.cpp is to ensure that the code correctly
propagates the error received from the OS.
More information about the All-commits
mailing list