mirror of
https://mirror.suhoan.cn/https://github.com/EasyTier/EasyTier.git
synced 2025-12-12 20:57:26 +08:00
Compare commits
2 Commits
manage-con
...
releases/v
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a102a8bfc7 | ||
|
|
c9e8c35e77 |
@@ -968,8 +968,17 @@ impl NetworkOptions {
|
||||
old_udp_whitelist.extend(self.udp_whitelist.clone());
|
||||
cfg.set_udp_whitelist(old_udp_whitelist);
|
||||
|
||||
cfg.set_stun_servers(self.stun_servers.clone());
|
||||
cfg.set_stun_servers_v6(self.stun_servers_v6.clone());
|
||||
if let Some(stun_servers) = &self.stun_servers {
|
||||
let mut old_stun_servers = cfg.get_stun_servers().unwrap_or_default();
|
||||
old_stun_servers.extend(stun_servers.iter().cloned());
|
||||
cfg.set_stun_servers(Some(old_stun_servers));
|
||||
}
|
||||
|
||||
if let Some(stun_servers_v6) = &self.stun_servers_v6 {
|
||||
let mut old_stun_servers_v6 = cfg.get_stun_servers_v6().unwrap_or_default();
|
||||
old_stun_servers_v6.extend(stun_servers_v6.iter().cloned());
|
||||
cfg.set_stun_servers_v6(Some(old_stun_servers_v6));
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -384,7 +384,11 @@ pub(crate) fn setup_sokcet2_ext(
|
||||
unsafe {
|
||||
let dev_idx = nix::libc::if_nametoindex(dev_name.as_str().as_ptr() as *const i8);
|
||||
tracing::warn!(?dev_idx, ?dev_name, "bind device");
|
||||
if bind_addr.is_ipv4() {
|
||||
socket2_socket.bind_device_by_index_v4(std::num::NonZeroU32::new(dev_idx))?;
|
||||
} else {
|
||||
socket2_socket.bind_device_by_index_v6(std::num::NonZeroU32::new(dev_idx))?;
|
||||
}
|
||||
tracing::warn!(?dev_idx, ?dev_name, "bind device doen");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,9 +81,14 @@ pub fn init_logger(
|
||||
});
|
||||
}
|
||||
|
||||
let dir = file_config.dir.as_deref().unwrap_or(".");
|
||||
let file = file_config.file.as_deref().unwrap_or("easytier.log");
|
||||
let path = std::path::Path::new(dir).join(file);
|
||||
let path_str = path.to_string_lossy().into_owned();
|
||||
|
||||
let builder = RollingFileAppenderBase::builder();
|
||||
let file_appender = builder
|
||||
.filename(file_config.file.unwrap_or("easytier.log".to_string()))
|
||||
.filename(path_str)
|
||||
.condition_daily()
|
||||
.max_filecount(file_config.count.unwrap_or(10))
|
||||
.condition_max_file_size(file_config.size_mb.unwrap_or(100) * 1024 * 1024)
|
||||
|
||||
Reference in New Issue
Block a user