From ede7d0518ef9245c70531b8dee398cc03056f5c1 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 8 Apr 2019 11:23:23 +0930 Subject: [PATCH] connectd: unlink any old socket when we use --bind-addr. They don't clean up after themselves, so best we do it here (by this point we've already done the pid check to make sure we're the only lightningd here anyway). Signed-off-by: Rusty Russell --- connectd/connectd.c | 2 ++ tests/test_misc.py | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/connectd/connectd.c b/connectd/connectd.c index f3a597f19..ab1a9d9a1 100644 --- a/connectd/connectd.c +++ b/connectd/connectd.c @@ -988,6 +988,8 @@ static struct wireaddr_internal *setup_listeners(const tal_t *ctx, addrun.sun_family = AF_UNIX; memcpy(addrun.sun_path, wa.u.sockname, sizeof(addrun.sun_path)); + /* Remove any existing one. */ + unlink(wa.u.sockname); fd = make_listen_fd(AF_UNIX, &addrun, sizeof(addrun), false); status_trace("Created socket listener on file %s", diff --git a/tests/test_misc.py b/tests/test_misc.py index 1d40cf7e9..f512a5d43 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -566,7 +566,6 @@ def test_io_logging(node_factory, executor): assert any(l['type'] == 'IO_IN' for l in peerlog) -@pytest.mark.xfail(strict=True) def test_address(node_factory): if DEVELOPER: opts = {'dev-allow-localhost': None}