aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/rendezvous_server.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/rendezvous_server.rs b/src/rendezvous_server.rs
index 88cd6cb..5aba4d4 100644
--- a/src/rendezvous_server.rs
+++ b/src/rendezvous_server.rs
@@ -1188,8 +1188,16 @@ impl RendezvousServer {
#[inline]
fn is_lan(&self, addr: SocketAddr) -> bool {
if let Some(network) = &self.inner.mask {
- if let SocketAddr::V4(addr) = addr {
- return network.contains(*addr.ip());
+ match addr {
+ SocketAddr::V4(v4_socket_addr) => {
+ return network.contains(*v4_socket_addr.ip());
+ }
+
+ SocketAddr::V6(v6_socket_addr) => {
+ if let Some(v4_addr) = v6_socket_addr.ip().to_ipv4_mapped() {
+ return network.contains(v4_addr);
+ }
+ }
}
}
false