From 9f8feeab71ccb864606c336097e20dbb8e1d8c86 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 1 Nov 2026 05:22:38 +0100 Subject: libp2p: autoignore unroutable address ranges --- src/transport/libp2p/config.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/transport/libp2p/config.rs') diff --git a/src/transport/libp2p/config.rs b/src/transport/libp2p/config.rs index 4db8444..6d26224 100644 --- a/src/transport/libp2p/config.rs +++ b/src/transport/libp2p/config.rs @@ -25,6 +25,9 @@ pub(crate) struct Libp2pConfig { pub(crate) ignore: Vec, /// Address ranges that matter most, best first (`Book::preference`). pub(crate) prefer: Vec, + /// Hosts on the internet (names or addresses) whose routes tell whether there is + /// one to the internet at all (`Routes::internet`). + pub(crate) internet_hosts: Vec, /// Use public infrastructure: the IPFS DHT, public relays. pub(crate) public: bool, /// libp2p's in-memory transport instead of TCP and QUIC: for tests. @@ -126,6 +129,7 @@ impl Libp2pConfig { upnp: settings.libp2p_upnp, ignore: parse_ranges("libp2p-ignore", &settings.libp2p_ignore)?, prefer: parse_ranges("libp2p-prefer", &settings.libp2p_prefer)?, + internet_hosts: settings.libp2p_internet_hosts.clone(), public: settings.libp2p_public, memory: false, }) -- cgit v1.3.1