mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-10-13 15:56:14 -08:00
fix magic-dns feature gate
This commit is contained in:
1 parent
d94cb3a96d
commit
385ff54b3e
13 files changed
+156
-117
No files matched your search
@@ -1,7 +1,6 @@
|
||||
use std::collections::BTreeSet;
|
||||
use std::net::IpAddr;
|
||||
use std::sync::{Arc, Weak};
|
||||
use std::time::Instant;
|
||||
|
||||
use crate::common::global_ctx::{ArcGlobalCtx, GlobalCtxEvent};
|
||||
use crate::common::scoped_task::ScopedTask;
|
||||
@@ -55,11 +54,15 @@ impl ProxyCidrsMonitor {
|
||||
proxy_cidrs = routes.into_iter().collect();
|
||||
}
|
||||
|
||||
if let Some(dns) = global_ctx.get_dns() {
|
||||
proxy_cidrs.extend(dns.addresses().into_iter().filter_map(|a| match a.ip() {
|
||||
IpAddr::V4(ip) => Some(cidr::Ipv4Cidr::new_host(ip)),
|
||||
_ => None,
|
||||
}))
|
||||
#[cfg(feature = "magic-dns")]
|
||||
{
|
||||
use crate::dns::config::DnsGlobalCtxExt;
|
||||
if let Some(dns) = global_ctx.dns_server() {
|
||||
proxy_cidrs.extend(dns.addresses().into_iter().filter_map(|a| match a.ip() {
|
||||
IpAddr::V4(ip) => Some(cidr::Ipv4Cidr::new_host(ip)),
|
||||
_ => None,
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
// Calculate diff
|
||||
|
||||
Reference in new issue
Block a user