mirror of
https://github.com/shadowsocks/shadowsocks-rust.git
synced 2026-02-09 01:59:16 +08:00
chore(deps): bump tun2 from 2.0.8 to 3.1.0 (#1640)
* chore(deps): bump tun2 from 2.0.8 to 3.1.0 Bumps [tun2](https://github.com/ssrlive/rust-tun) from 2.0.8 to 3.1.0. - [Release notes](https://github.com/ssrlive/rust-tun/releases) - [Commits](https://github.com/ssrlive/rust-tun/commits) --- updated-dependencies: - dependency-name: tun2 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * fix: AsyncDevice impls Deref * fix: fake tun impls Deref --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: zonyitoo <zonyitoo@gmail.com>
This commit is contained in:
106
Cargo.lock
generated
106
Cargo.lock
generated
@@ -198,6 +198,18 @@ version = "0.7.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711"
|
||||
|
||||
[[package]]
|
||||
name = "async-channel"
|
||||
version = "2.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a"
|
||||
dependencies = [
|
||||
"concurrent-queue",
|
||||
"event-listener-strategy",
|
||||
"futures-core",
|
||||
"pin-project-lite",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "async-compression"
|
||||
version = "0.4.12"
|
||||
@@ -214,6 +226,12 @@ dependencies = [
|
||||
"zstd-safe",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "async-task"
|
||||
version = "4.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de"
|
||||
|
||||
[[package]]
|
||||
name = "async-trait"
|
||||
version = "0.1.82"
|
||||
@@ -334,6 +352,19 @@ dependencies = [
|
||||
"generic-array",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "blocking"
|
||||
version = "1.6.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea"
|
||||
dependencies = [
|
||||
"async-channel",
|
||||
"async-task",
|
||||
"futures-io",
|
||||
"futures-lite",
|
||||
"piper",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bloomfilter"
|
||||
version = "1.0.14"
|
||||
@@ -579,6 +610,15 @@ version = "1.0.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0"
|
||||
|
||||
[[package]]
|
||||
name = "concurrent-queue"
|
||||
version = "2.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973"
|
||||
dependencies = [
|
||||
"crossbeam-utils",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "const-oid"
|
||||
version = "0.9.6"
|
||||
@@ -915,6 +955,27 @@ dependencies = [
|
||||
"arrayvec",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "event-listener"
|
||||
version = "5.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba"
|
||||
dependencies = [
|
||||
"concurrent-queue",
|
||||
"parking",
|
||||
"pin-project-lite",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "event-listener-strategy"
|
||||
version = "0.5.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1"
|
||||
dependencies = [
|
||||
"event-listener",
|
||||
"pin-project-lite",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fastrand"
|
||||
version = "1.9.0"
|
||||
@@ -1065,6 +1126,16 @@ version = "0.3.30"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1"
|
||||
|
||||
[[package]]
|
||||
name = "futures-lite"
|
||||
version = "2.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5"
|
||||
dependencies = [
|
||||
"futures-core",
|
||||
"pin-project-lite",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "futures-macro"
|
||||
version = "0.3.30"
|
||||
@@ -2258,6 +2329,12 @@ dependencies = [
|
||||
"primeorder",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "parking"
|
||||
version = "2.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae"
|
||||
|
||||
[[package]]
|
||||
name = "parking_lot"
|
||||
version = "0.11.2"
|
||||
@@ -2389,6 +2466,17 @@ version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
|
||||
|
||||
[[package]]
|
||||
name = "piper"
|
||||
version = "0.2.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066"
|
||||
dependencies = [
|
||||
"atomic-waker",
|
||||
"fastrand 2.1.0",
|
||||
"futures-io",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pkcs8"
|
||||
version = "0.10.2"
|
||||
@@ -3002,12 +3090,6 @@ dependencies = [
|
||||
"untrusted 0.9.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustversion"
|
||||
version = "1.0.17"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6"
|
||||
|
||||
[[package]]
|
||||
name = "ryu"
|
||||
version = "1.0.18"
|
||||
@@ -3915,19 +3997,19 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
|
||||
|
||||
[[package]]
|
||||
name = "tun2"
|
||||
version = "2.0.8"
|
||||
version = "3.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c1576993bcdccd110d21278396df090cb29219d296a8b8daa697442efdaab0c6"
|
||||
checksum = "3366b114fae60f63e950beaa078af7215adac5879085d3c3715b93ef40d47efc"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"cfg-if",
|
||||
"futures",
|
||||
"futures-core",
|
||||
"ipnet",
|
||||
"libc",
|
||||
"libloading",
|
||||
"log",
|
||||
"nix",
|
||||
"rustversion",
|
||||
"thiserror",
|
||||
"tokio",
|
||||
"tokio-util",
|
||||
@@ -4435,11 +4517,13 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wintun-bindings"
|
||||
version = "0.6.2"
|
||||
version = "0.7.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "79260cdfee91a3de3a0fe0f04b81b695e69c68b170cd6a643746904a8c14da63"
|
||||
checksum = "70756f591de368f0f4ad2761de198e8ab535551a59942a46da25328af0864b29"
|
||||
dependencies = [
|
||||
"blocking",
|
||||
"c2rust-bitfields",
|
||||
"futures",
|
||||
"libloading",
|
||||
"log",
|
||||
"thiserror",
|
||||
|
||||
@@ -186,7 +186,7 @@ flate2 = { version = "1.0", optional = true }
|
||||
brotli = { version = "6.0", optional = true }
|
||||
zstd = { version = "0.13", optional = true }
|
||||
|
||||
tun2 = { version = "2.0.8", optional = true, default-features = false, features = [
|
||||
tun2 = { version = "3.1.0", optional = true, default-features = false, features = [
|
||||
"async",
|
||||
] }
|
||||
etherparse = { version = "0.15", optional = true }
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
use std::{
|
||||
io::{self, Read, Write},
|
||||
net::IpAddr,
|
||||
ops::{Deref, DerefMut},
|
||||
pin::Pin,
|
||||
task::{Context, Poll},
|
||||
};
|
||||
@@ -118,6 +119,20 @@ impl AsMut<FakeDevice> for AsyncDevice {
|
||||
}
|
||||
}
|
||||
|
||||
impl Deref for AsyncDevice {
|
||||
type Target = FakeDevice;
|
||||
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.0
|
||||
}
|
||||
}
|
||||
|
||||
impl DerefMut for AsyncDevice {
|
||||
fn deref_mut(&mut self) -> &mut Self::Target {
|
||||
&mut self.0
|
||||
}
|
||||
}
|
||||
|
||||
impl AsyncRead for AsyncDevice {
|
||||
fn poll_read(self: Pin<&mut Self>, _cx: &mut Context<'_>, _buf: &mut ReadBuf<'_>) -> Poll<io::Result<()>> {
|
||||
Err(io::Error::new(io::ErrorKind::Other, "not implemented")).into()
|
||||
|
||||
@@ -128,11 +128,7 @@ impl TunBuilder {
|
||||
self.udp_capacity,
|
||||
);
|
||||
|
||||
let tcp = TcpTun::new(
|
||||
self.context,
|
||||
self.balancer,
|
||||
device.as_ref().mtu().unwrap_or(1500) as u32,
|
||||
);
|
||||
let tcp = TcpTun::new(self.context, self.balancer, device.mtu().unwrap_or(1500) as u32);
|
||||
|
||||
Ok(Tun {
|
||||
device,
|
||||
@@ -160,15 +156,11 @@ impl Tun {
|
||||
pub async fn run(mut self) -> io::Result<()> {
|
||||
info!(
|
||||
"shadowsocks tun device {}, mode {}",
|
||||
self.device
|
||||
.as_ref()
|
||||
.tun_name()
|
||||
.or_else(|r| Ok::<_, ()>(r.to_string()))
|
||||
.unwrap(),
|
||||
self.device.tun_name().or_else(|r| Ok::<_, ()>(r.to_string())).unwrap(),
|
||||
self.mode,
|
||||
);
|
||||
|
||||
let address = match self.device.as_ref().address() {
|
||||
let address = match self.device.address() {
|
||||
Ok(a) => a,
|
||||
Err(err) => {
|
||||
error!("[TUN] failed to get device address, error: {}", err);
|
||||
@@ -176,7 +168,7 @@ impl Tun {
|
||||
}
|
||||
};
|
||||
|
||||
let netmask = match self.device.as_ref().netmask() {
|
||||
let netmask = match self.device.netmask() {
|
||||
Ok(n) => n,
|
||||
Err(err) => {
|
||||
error!("[TUN] failed to get device netmask, error: {}", err);
|
||||
|
||||
Reference in New Issue
Block a user