From 46b799c0771bb80e7b2b4b9031bbb306f67ec17e Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Sun, 23 May 2021 15:36:53 +0200 Subject: passt: When probing for an existing instance, also accept ENOENT on connect() The most common case is actually that no other instance created a socket with that name -- and that also means there is no other instance. Signed-off-by: Stefano Brivio --- passt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/passt.c b/passt.c index 2f538e4..46eb5f6 100644 --- a/passt.c +++ b/passt.c @@ -104,7 +104,7 @@ static int sock_unix(int *index) ex = socket(AF_UNIX, SOCK_STREAM | SOCK_NONBLOCK, 0); ret = connect(ex, (const struct sockaddr *)&addr, sizeof(addr)); - if (!ret || errno != ECONNREFUSED) { + if (!ret || (errno != ENOENT && errno != ECONNREFUSED)) { close(ex); continue; } -- cgit v1.2.3