[Lldb-commits] [PATCH] D133393: [test] Use either `127.0.0.1` or `[::1]` to run in ipv6-only environments.

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Sep 9 02:37:48 PDT 2022


labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

In D133393#3775995 <https://reviews.llvm.org/D133393#3775995>, @rupprecht wrote:

> In D133393#3773793 <https://reviews.llvm.org/D133393#3773793>, @labath wrote:
>
>> I believe the reasons are still relevant. Basically the problem is that listening on `localhost:x` creates two sockets (one for 127.0.0.1, one for ::1), and there's no way to guarantee that we'll be able to grab the same port for both (one could be taken by some other application). Our listening code will succeed if it opens at least one socket, but then if we again try to connect using the `localhost` name, we may end up connecting to the wrong thing. I think the correct fix is to take the address (ip+port) that we've *actually* started listening on, and then pass *that* as the argument to the connect command, but I'm not sure if our current Socket APIs allow you to get that information.
>
> There's `listen_socket.GetLocalIPAddress()`, but that returns an empty string here.

Yeah, that probably only works on connected sockets.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133393/new/

https://reviews.llvm.org/D133393



More information about the lldb-commits mailing list