aboutsummaryrefslogtreecommitdiffstats
path: root/src/transport/libp2p/config.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-01 05:22:38 +0100
committertv <tv@krebsco.de>2026-11-01 05:22:38 +0100
commit6bab0c4af15988e3c0d4e38de3ee9c1f8c4a8be2 (patch)
tree088b1c5156ce237f0be885f620b28a7d1252b333 /src/transport/libp2p/config.rs
parent35eade856a9b445920ec07eacdeaf153239d8ec9 (diff)
libp2p: autoignore unroutable address ranges
Diffstat (limited to 'src/transport/libp2p/config.rs')
-rw-r--r--src/transport/libp2p/config.rs4
1 files changed, 4 insertions, 0 deletions
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<IpRange>,
/// Address ranges that matter most, best first (`Book::preference`).
pub(crate) prefer: Vec<IpRange>,
+ /// 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<String>,
/// 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,
})