From 0f90262589ccdf81ff02549bb70e898886f75852 Mon Sep 17 00:00:00 2001 From: Konstantin Bogomolov Date: Wed, 17 Jul 2024 17:37:57 +0000 Subject: executor: manually replace localhost with equivalent ipv4/6 address It should fix errors like this one: SYZFAIL: failed to resolve manager addr addr=localhost h_errno=2 (errno 11: Resource temporarily unavailable --- executor/conn.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'executor/conn.h') diff --git a/executor/conn.h b/executor/conn.h index 1a329a246..cf099346c 100644 --- a/executor/conn.h +++ b/executor/conn.h @@ -96,6 +96,7 @@ private: static int Connect(const char* addr, const char* ports) { int port = atoi(ports); + bool localhost = !strcmp(addr, "localhost"); if (!strcmp(addr, "stdin")) return STDIN_FILENO; if (port == 0) @@ -103,11 +104,15 @@ private: sockaddr_in saddr4 = {}; saddr4.sin_family = AF_INET; saddr4.sin_port = htons(port); + if (localhost) + addr = "127.0.0.1"; if (inet_pton(AF_INET, addr, &saddr4.sin_addr)) return Connect(&saddr4, &saddr4.sin_addr, port); sockaddr_in6 saddr6 = {}; saddr6.sin6_family = AF_INET6; saddr6.sin6_port = htons(port); + if (localhost) + addr = "0:0:0:0:0:0:0:1"; if (inet_pton(AF_INET6, addr, &saddr6.sin6_addr)) return Connect(&saddr6, &saddr6.sin6_addr, port); auto* hostent = gethostbyname(addr); -- cgit mrf-deployment