mirror of
https://mirror.suhoan.cn/https://github.com/EasyTier/EasyTier.git
synced 2025-12-14 05:37:23 +08:00
fix run with config, update readme (#118)
This commit is contained in:
@@ -205,7 +205,14 @@ impl TomlConfigLoader {
|
||||
pub fn new(config_path: &PathBuf) -> Result<Self, anyhow::Error> {
|
||||
let config_str = std::fs::read_to_string(config_path)
|
||||
.with_context(|| format!("failed to read config file: {:?}", config_path))?;
|
||||
Self::new_from_str(&config_str)
|
||||
let ret = Self::new_from_str(&config_str)?;
|
||||
let old_ns = ret.get_network_identity();
|
||||
ret.set_network_identity(NetworkIdentity::new(
|
||||
old_ns.network_name,
|
||||
old_ns.network_secret.unwrap_or_default(),
|
||||
));
|
||||
|
||||
Ok(ret)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -156,6 +156,9 @@ const PAYLOAD_OFFSET_FOR_NIC_PACKET: usize = max(
|
||||
WG_TUNNEL_HEADER_SIZE,
|
||||
) + PEER_MANAGER_HEADER_SIZE;
|
||||
|
||||
// UDP Tunnel: TUN MTU + 24 (Easy) + 20 (Encrypted) + 8(UDP) + 20(IP) = TUN MTU + 72
|
||||
// TCP Tunnel: TUN MTU + 20 (Easy) + 20 (Encrypted) + 20(TCP) + 20(IP) = TUN MTU + 80
|
||||
|
||||
const INVALID_OFFSET: usize = usize::MAX;
|
||||
|
||||
const fn get_converted_offset(old_hdr_size: usize, new_hdr_size: usize) -> usize {
|
||||
|
||||
Reference in New Issue
Block a user