From 76cd0b3bd8f9bf09ea8de2beac4eb79109195591 Mon Sep 17 00:00:00 2001 From: Niko PLP Date: Sun, 25 Jun 2023 17:13:23 +0300 Subject: [PATCH] allowing public IPv6 on private interface, because DMZ can do that --- p2p-net/src/types.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/p2p-net/src/types.rs b/p2p-net/src/types.rs index 751f463..e7cfe8c 100644 --- a/p2p-net/src/types.rs +++ b/p2p-net/src/types.rs @@ -63,7 +63,7 @@ impl InterfaceType { InterfaceType::Loopback => ip.is_loopback(), InterfaceType::Public => is_public_ipv6(ip), // we do NOT allow to bind to link-local for IPv6 - InterfaceType::Private => is_ipv6_private(ip), + InterfaceType::Private => is_ipv6_private(ip) || is_public_ipv6(ip), _ => false, } } @@ -214,6 +214,12 @@ impl AcceptForwardForV0 { _ => false, } } + pub fn domain_with_common_peer_id(&self) -> Option { + match self { + AcceptForwardForV0::PublicDomainPeer((_, privkey, _)) => Some(privkey.to_pub()), + _ => None, + } + } pub fn get_domain(&self) -> &str { let domain = get_domain_without_port_443(match self { AcceptForwardForV0::PrivateDomain((d, _)) => d,