Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions connectd/connectd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1134,7 +1134,10 @@ static void try_connect_one_addr(struct connecting *connect)
hints.ai_socktype = SOCK_STREAM;
hints.ai_family = AF_UNSPEC;
hints.ai_protocol = 0;
/* AI_ADDRCONFIG speeds up connects on single-stack hosts by
* pruning unreachable address families. */
hints.ai_flags = AI_ADDRCONFIG;

gai_err = getaddrinfo((char *)addr->u.wireaddr.wireaddr.addr,
tal_fmt(tmpctx, "%d",
addr->u.wireaddr.wireaddr.port),
Expand Down
3 changes: 3 additions & 0 deletions tests/test_gossip.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import pytest
import struct
import subprocess
import sys
import time
import unittest
import shutil
Expand Down Expand Up @@ -186,6 +187,8 @@ def test_announce_dns_suppressed(node_factory, bitcoind):
assert addresses[0]['port'] == 1236


@unittest.skipIf(sys.platform == "darwin",
"localhost.localdomain not in /etc/hosts on macOS by default")
def test_announce_and_connect_via_dns(node_factory, bitcoind):
""" Test that DNS announcements propagate and can be used when connecting.

Expand Down
Loading