Browse Source

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 <rusty@rustcorp.com.au>
pr-2587
Rusty Russell 6 years ago
committed by Christian Decker
parent
commit
ede7d0518e
  1. 2
      connectd/connectd.c
  2. 1
      tests/test_misc.py

2
connectd/connectd.c

@ -988,6 +988,8 @@ static struct wireaddr_internal *setup_listeners(const tal_t *ctx,
addrun.sun_family = AF_UNIX; addrun.sun_family = AF_UNIX;
memcpy(addrun.sun_path, wa.u.sockname, memcpy(addrun.sun_path, wa.u.sockname,
sizeof(addrun.sun_path)); sizeof(addrun.sun_path));
/* Remove any existing one. */
unlink(wa.u.sockname);
fd = make_listen_fd(AF_UNIX, &addrun, sizeof(addrun), fd = make_listen_fd(AF_UNIX, &addrun, sizeof(addrun),
false); false);
status_trace("Created socket listener on file %s", status_trace("Created socket listener on file %s",

1
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) assert any(l['type'] == 'IO_IN' for l in peerlog)
@pytest.mark.xfail(strict=True)
def test_address(node_factory): def test_address(node_factory):
if DEVELOPER: if DEVELOPER:
opts = {'dev-allow-localhost': None} opts = {'dev-allow-localhost': None}

Loading…
Cancel
Save