diff --git a/README.md b/README.md index c9e5087..c7787b0 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,8 @@ [![GitHub](https://img.shields.io/github/license/KKRainbow/EasyTier)](https://github.com/KKRainbow/EasyTier/blob/main/LICENSE) [![GitHub last commit](https://img.shields.io/github/last-commit/KKRainbow/EasyTier)](https://github.com/KKRainbow/EasyTier/commits/main) [![GitHub issues](https://img.shields.io/github/issues/KKRainbow/EasyTier)](https://github.com/KKRainbow/EasyTier/issues) - [![GitHub actions](https://github.com/KKRainbow/EasyTier/actions/workflows/rust.yml/badge.svg)](https://github.com/KKRainbow/EasyTier/actions/) + [![GitHub Core Actions](https://github.com/KKRainbow/EasyTier/actions/workflows/core.yml/badge.svg)](https://github.com/EasyTier/EasyTier/actions/workflows/core.yml) + [![GitHub GUI Actions](https://github.com/KKRainbow/EasyTier/actions/workflows/gui.yml/badge.svg)](https://github.com/EasyTier/EasyTier/actions/workflows/gui.yml) [简体中文](/README_CN.md) | [English](/README.md) @@ -259,6 +260,7 @@ Before using the Client Config, you need to modify the Interface Address and Pee - [ZeroTier](https://www.zerotier.com/): A global virtual network for connecting devices. - [TailScale](https://tailscale.com/): A VPN solution aimed at simplifying network configuration. - [vpncloud](https://github.com/dswd/vpncloud): A P2P Mesh VPN + - [Candy](https://github.com/lanthora/candy): A reliable, low-latency, and anti-censorship virtual private network # License diff --git a/README_CN.md b/README_CN.md index 8016664..8ad9288 100644 --- a/README_CN.md +++ b/README_CN.md @@ -3,7 +3,8 @@ [![GitHub](https://img.shields.io/github/license/KKRainbow/EasyTier)](https://github.com/KKRainbow/EasyTier/blob/main/LICENSE) [![GitHub last commit](https://img.shields.io/github/last-commit/KKRainbow/EasyTier)](https://github.com/KKRainbow/EasyTier/commits/main) [![GitHub issues](https://img.shields.io/github/issues/KKRainbow/EasyTier)](https://github.com/KKRainbow/EasyTier/issues) -[![GitHub actions](https://github.com/KKRainbow/EasyTier/actions/workflows/rust.yml/badge.svg)](https://github.com/KKRainbow/EasyTier/actions/) +[![GitHub Core Actions](https://github.com/KKRainbow/EasyTier/actions/workflows/core.yml/badge.svg)](https://github.com/EasyTier/EasyTier/actions/workflows/core.yml) +[![GitHub GUI Actions](https://github.com/KKRainbow/EasyTier/actions/workflows/gui.yml/badge.svg)](https://github.com/EasyTier/EasyTier/actions/workflows/gui.yml) [简体中文](/README_CN.md) | [English](/README.md) @@ -262,6 +263,7 @@ connected_clients: - [ZeroTier](https://www.zerotier.com/): 一个全球虚拟网络,用于连接设备。 - [TailScale](https://tailscale.com/): 一个旨在简化网络配置的 VPN 解决方案。 - [vpncloud](https://github.com/dswd/vpncloud): 一个 P2P Mesh VPN +- [Candy](https://github.com/lanthora/candy): 可靠、低延迟、抗审查的虚拟专用网络 # 许可证 diff --git a/easytier/src/common/config.rs b/easytier/src/common/config.rs index 81960f3..78f05c1 100644 --- a/easytier/src/common/config.rs +++ b/easytier/src/common/config.rs @@ -205,7 +205,14 @@ impl TomlConfigLoader { pub fn new(config_path: &PathBuf) -> Result { 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) } } diff --git a/easytier/src/tunnel/packet_def.rs b/easytier/src/tunnel/packet_def.rs index 8cba431..9545ed2 100644 --- a/easytier/src/tunnel/packet_def.rs +++ b/easytier/src/tunnel/packet_def.rs @@ -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 {