From 837fe8a35024a801ad30ac764e4ac3a3f01134d8 Mon Sep 17 00:00:00 2001 From: ExpressVPN Automation Bot <143369453+expressvpn-iat-bot@users.noreply.github.com> Date: Tue, 31 Dec 2024 05:54:42 +0000 Subject: [PATCH 1/3] [auto] Update cargo dependencies ```console $ cargo update Updating crates.io index Updating git repository `https://github.com/expressvpn/wolfssl-rs` Updating git submodule `https://github.com/wolfSSL/wolfssl.git` Locking 8 packages to latest compatible versions Updating glob v0.3.1 -> v0.3.2 Updating io-uring v0.7.2 -> v0.7.3 Updating serde v1.0.216 -> v1.0.217 Updating serde_derive v1.0.216 -> v1.0.217 Updating syn v2.0.92 -> v2.0.93 Updating tun v0.7.6 -> v0.7.10 Removing windows-sys v0.48.0 Removing windows-targets v0.48.5 Removing windows_aarch64_gnullvm v0.48.5 Removing windows_aarch64_msvc v0.48.5 Removing windows_i686_gnu v0.48.5 Removing windows_i686_msvc v0.48.5 Removing windows_x86_64_gnu v0.48.5 Removing windows_x86_64_gnullvm v0.48.5 Removing windows_x86_64_msvc v0.48.5 Removing winreg v0.52.0 Adding winreg2 v0.53.1 Updating wintun-bindings v0.7.23 -> v0.7.27 note: pass `--verbose` to see 3 unchanged dependencies behind latest ``` --- Cargo.lock | 180 +++++++++++++++++------------------------------------ 1 file changed, 57 insertions(+), 123 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index afbfc67..7d0decc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -146,7 +146,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.92", + "syn 2.0.93", ] [[package]] @@ -193,7 +193,7 @@ dependencies = [ "miniz_oxide", "object", "rustc-demangle", - "windows-targets 0.52.6", + "windows-targets", ] [[package]] @@ -225,7 +225,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.92", + "syn 2.0.93", ] [[package]] @@ -371,7 +371,7 @@ dependencies = [ "iana-time-zone", "num-traits", "serde", - "windows-targets 0.52.6", + "windows-targets", ] [[package]] @@ -425,7 +425,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.92", + "syn 2.0.93", ] [[package]] @@ -566,7 +566,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.92", + "syn 2.0.93", ] [[package]] @@ -588,7 +588,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core 0.20.10", "quote", - "syn 2.0.92", + "syn 2.0.93", ] [[package]] @@ -599,7 +599,7 @@ checksum = "4e018fccbeeb50ff26562ece792ed06659b9c2dae79ece77c4456bb10d9bf79b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.92", + "syn 2.0.93", ] [[package]] @@ -636,7 +636,7 @@ dependencies = [ "quote", "sha3", "strum", - "syn 2.0.92", + "syn 2.0.93", "void", ] @@ -708,7 +708,7 @@ dependencies = [ "enum-ordinalize", "proc-macro2", "quote", - "syn 2.0.92", + "syn 2.0.93", ] [[package]] @@ -740,7 +740,7 @@ checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" dependencies = [ "proc-macro2", "quote", - "syn 2.0.92", + "syn 2.0.93", ] [[package]] @@ -885,7 +885,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.92", + "syn 2.0.93", ] [[package]] @@ -949,9 +949,9 @@ checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "glob" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "hashbrown" @@ -1063,9 +1063,9 @@ dependencies = [ [[package]] name = "io-uring" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c96e3f73fd5acaee84ecfabb4414875b688667b5276372cdeff64444fab81ee" +checksum = "c5d5b4a5e02a58296749114728ea3644f9a4cd5669c243896e445b90bd299ad6" dependencies = [ "bitflags", "cfg-if", @@ -1183,7 +1183,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ "cfg-if", - "windows-targets 0.52.6", + "windows-targets", ] [[package]] @@ -1525,7 +1525,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.92", + "syn 2.0.93", ] [[package]] @@ -1654,7 +1654,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.92", + "syn 2.0.93", ] [[package]] @@ -1737,7 +1737,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ "proc-macro2", - "syn 2.0.92", + "syn 2.0.93", ] [[package]] @@ -1928,22 +1928,22 @@ checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "serde" -version = "1.0.216" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.216" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.92", + "syn 2.0.93", ] [[package]] @@ -1985,7 +1985,7 @@ dependencies = [ "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.92", + "syn 2.0.93", ] [[package]] @@ -2144,7 +2144,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.92", + "syn 2.0.93", ] [[package]] @@ -2166,9 +2166,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.92" +version = "2.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ae51629bf965c5c098cc9e87908a3df5301051a9e087d6f9bef5c9771ed126" +checksum = "9c786062daee0d6db1132800e623df74274a0a87322d8e183338e01b3d98d058" dependencies = [ "proc-macro2", "quote", @@ -2193,7 +2193,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.92", + "syn 2.0.93", ] [[package]] @@ -2204,7 +2204,7 @@ checksum = "5c89e72a01ed4c579669add59014b9a524d609c0c88c6a585ce37485879f6ffb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.92", + "syn 2.0.93", "test-case-core", ] @@ -2234,7 +2234,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.92", + "syn 2.0.93", ] [[package]] @@ -2245,7 +2245,7 @@ checksum = "7b50fa271071aae2e6ee85f842e2e28ba8cd2c5fb67f11fcb1fd70b276f9e7d4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.92", + "syn 2.0.93", ] [[package]] @@ -2324,7 +2324,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.92", + "syn 2.0.93", ] [[package]] @@ -2399,7 +2399,7 @@ checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.92", + "syn 2.0.93", ] [[package]] @@ -2452,9 +2452,9 @@ dependencies = [ [[package]] name = "tun" -version = "0.7.6" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba298d04c774b3c463237ccd60e33ad2ac5c0de5cb58cede79cdb3059d019a82" +checksum = "5b5ea2466ffcdd0be0831f7d3981daa0b953586c0062f6d33398cb374689b090" dependencies = [ "bytes", "cfg-if", @@ -2562,7 +2562,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn 2.0.92", + "syn 2.0.93", "wasm-bindgen-shared", ] @@ -2584,7 +2584,7 @@ checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.92", + "syn 2.0.93", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2633,16 +2633,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", + "windows-targets", ] [[package]] @@ -2651,7 +2642,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.6", + "windows-targets", ] [[package]] @@ -2660,22 +2651,7 @@ version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", + "windows-targets", ] [[package]] @@ -2684,46 +2660,28 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - [[package]] name = "windows_i686_gnu" version = "0.52.6" @@ -2736,48 +2694,24 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - [[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - [[package]] name = "windows_x86_64_msvc" version = "0.52.6" @@ -2794,20 +2728,20 @@ dependencies = [ ] [[package]] -name = "winreg" -version = "0.52.0" +name = "winreg2" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" +checksum = "e25225e44ce2ac6b72befed6416b0857cf8663f9963dba572c39473062f0e625" dependencies = [ "cfg-if", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] name = "wintun-bindings" -version = "0.7.23" +version = "0.7.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6eb08e3b9f44685f52adae89c412470ed6a10bc2afe483d4938b32b7108a8a" +checksum = "8e35d3911efde5ee25586385204127ff6a3f251477dcdd3b222775aaa4d95977" dependencies = [ "blocking", "c2rust-bitfields", @@ -2816,7 +2750,7 @@ dependencies = [ "log", "thiserror 2.0.9", "windows-sys 0.59.0", - "winreg", + "winreg2", ] [[package]] @@ -2867,5 +2801,5 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.92", + "syn 2.0.93", ] From 0bf0dd6deb232ec88fbd756b27d365799a21a424 Mon Sep 17 00:00:00 2001 From: Mariappan Ramasamy <142216110+kp-mariappan-ramasamy@users.noreply.github.com> Date: Tue, 31 Dec 2024 15:58:15 +0800 Subject: [PATCH 2/3] app-utils: remove tokio-tun crate (replaced by tun) We changed the tunnel implementation from `tokio-tun` to `tun` recently. But skipped updating the example app which still uses tokio-tun This commit updates the example app to use tun and get rid of tokio-tun dep. --- Cargo.lock | 13 ------------ lightway-app-utils/Cargo.toml | 1 - lightway-app-utils/examples/udprelay.rs | 28 ++++++++++++++++--------- 3 files changed, 18 insertions(+), 24 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7d0decc..37072e9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1217,7 +1217,6 @@ dependencies = [ "tokio", "tokio-eventfd", "tokio-stream", - "tokio-tun", "tokio-util", "tracing", "tracing-subscriber", @@ -2338,18 +2337,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-tun" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bf48df2abbfd12d0b8495dcf960b125109493d85f2c787b44a2729a8022bc4b" -dependencies = [ - "libc", - "nix", - "thiserror 1.0.69", - "tokio", -] - [[package]] name = "tokio-util" version = "0.7.13" diff --git a/lightway-app-utils/Cargo.toml b/lightway-app-utils/Cargo.toml index 3a73a13..b9dbcc1 100644 --- a/lightway-app-utils/Cargo.toml +++ b/lightway-app-utils/Cargo.toml @@ -48,5 +48,4 @@ path = "examples/udprelay.rs" async-trait.workspace = true async-channel = { version = "2.1.1" } pnet.workspace = true -tokio-tun = "0.12.0" test-case.workspace = true diff --git a/lightway-app-utils/examples/udprelay.rs b/lightway-app-utils/examples/udprelay.rs index d17f467..26d0282 100644 --- a/lightway-app-utils/examples/udprelay.rs +++ b/lightway-app-utils/examples/udprelay.rs @@ -10,10 +10,11 @@ use lightway_core::IOCallbackResult; use pnet::packet::ipv4::MutableIpv4Packet; use std::net::{Ipv4Addr, SocketAddr}; +use std::os::fd::AsRawFd; use std::sync::Arc; use std::time::Duration; use tokio::net::UdpSocket; -use tokio_tun::Tun; +use tun::{AsyncDevice as Tun, Configuration as TunConfig}; const PORT: u16 = 40890; const CHANNEL_SIZE: usize = 32 * 1024; @@ -57,13 +58,14 @@ fn tun_peer_addr() -> Ipv4Addr { } async fn build_tun(name: String) -> Result { - let tun = Tun::builder() - .name(&name[..]) + let mut tun_config = TunConfig::default(); + tun_config + .tun_name(&name[..]) .mtu(TUN_MTU as _) .address(tun_local_addr()) .destination(tun_peer_addr()) - .up() - .try_build()?; + .up(); + let tun = tun::create_as_async(&tun_config)?; Ok(tun) } @@ -190,15 +192,22 @@ impl TunAdapter for TunChannel { } } +struct WrappedTun(Tun); +impl AsRawFd for WrappedTun { + fn as_raw_fd(&self) -> std::os::unix::prelude::RawFd { + self.0.as_raw_fd() + } +} + #[allow(dead_code)] struct TunIOUring { - tun_iouring: IOUring, + tun_iouring: IOUring, } impl TunIOUring { async fn new(tun: Tun, ring_size: usize, channel_size: usize) -> Result { let tun_iouring = IOUring::new( - Arc::new(tun), + Arc::new(WrappedTun(tun)), ring_size, channel_size, TUN_MTU, @@ -230,16 +239,15 @@ mod channel { use anyhow::Result; use async_channel::{Receiver, Sender}; use bytes::BytesMut; - use tokio_tun::Tun; + use tun::AsyncDevice as Tun; use super::TUN_MTU; - use std::os::fd::AsRawFd; use std::sync::Arc; use std::thread; use std::thread::JoinHandle; #[allow(missing_docs, dead_code)] - pub struct Channel { + pub struct Channel { owned_fd: Arc, io_uring_thread_handle: JoinHandle>, } From 2ada2f08c24c345193e3005039f5b374b96e4190 Mon Sep 17 00:00:00 2001 From: Mariappan Ramasamy <142216110+kp-mariappan-ramasamy@users.noreply.github.com> Date: Tue, 31 Dec 2024 16:02:05 +0800 Subject: [PATCH 3/3] deny: remove now unnecessary allowed duplicates --- deny.toml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/deny.toml b/deny.toml index 3b2905b..84df0f4 100644 --- a/deny.toml +++ b/deny.toml @@ -55,16 +55,7 @@ skip = [ { name = "syn", version = "1.0.109" }, { name = "thiserror", version = "1.0.69" }, { name = "thiserror-impl", version = "1.0.69" }, - { name = "windows-sys", version = "0.48.0" }, { name = "windows-sys", version = "0.52.0" }, - { name = "windows-targets", version = "0.48.5" }, - { name = "windows_aarch64_gnullvm", version = "0.48.5" }, - { name = "windows_aarch64_msvc", version = "0.48.5" }, - { name = "windows_i686_gnu", version = "0.48.5" }, - { name = "windows_i686_msvc", version = "0.48.5" }, - { name = "windows_x86_64_gnu", version = "0.48.5" }, - { name = "windows_x86_64_gnullvm", version = "0.48.5" }, - { name = "windows_x86_64_msvc", version = "0.48.5" }, ] [sources]