From 2efee249da2d1d2a58f5018498a0374970d64acf Mon Sep 17 00:00:00 2001 From: Yuwei Ba Date: Mon, 17 Jun 2024 13:31:02 +1000 Subject: [PATCH] feat: try to resolve default gateway interface on tun inbound traffic to avoid route loop (#458) --- Cargo.lock | 821 ++++++++++-------- bench/README.md | 70 ++ bench/flamegraph.svg | 491 +++++++++++ clash/tests/data/config/rules.yaml | 4 +- clash_lib/Cargo.toml | 2 + .../src/app/dispatcher/dispatcher_impl.rs | 49 +- clash_lib/src/app/outbound/manager.rs | 3 - clash_lib/src/common/io.rs | 59 +- clash_lib/src/proxy/converters/wireguard.rs | 1 - clash_lib/src/proxy/direct/mod.rs | 4 +- clash_lib/src/proxy/fallback/mod.rs | 4 +- clash_lib/src/proxy/loadbalance/mod.rs | 4 +- clash_lib/src/proxy/options.rs | 1 + clash_lib/src/proxy/relay/mod.rs | 3 +- clash_lib/src/proxy/selector/mod.rs | 5 +- clash_lib/src/proxy/shadowsocks/mod.rs | 7 +- .../proxy/shadowsocks/shadow_tls/connector.rs | 8 +- clash_lib/src/proxy/trojan/mod.rs | 8 +- clash_lib/src/proxy/tuic/mod.rs | 13 +- clash_lib/src/proxy/tun/inbound.rs | 19 +- clash_lib/src/proxy/urltest/mod.rs | 4 +- clash_lib/src/proxy/vmess/mod.rs | 8 +- .../src/proxy/vmess/vmess_impl/client.rs | 2 - clash_lib/src/proxy/wg/mod.rs | 4 +- 24 files changed, 1187 insertions(+), 407 deletions(-) create mode 100644 bench/README.md create mode 100644 bench/flamegraph.svg diff --git a/Cargo.lock b/Cargo.lock index 562cedaa4..6b9cfed05 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ "gimli", ] @@ -89,12 +89,6 @@ dependencies = [ "alloc-no-stdlib", ] -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - [[package]] name = "amplify" version = "4.6.0" @@ -162,47 +156,48 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] name = "anstream" -version = "0.6.13" +version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" [[package]] name = "anstyle-parse" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.2" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -282,9 +277,9 @@ checksum = "d92bec98840b8f03a5ff5413de5293bfcd8bf96467cf5452609f939ec6f5de16" [[package]] name = "async-compression" -version = "0.4.6" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a116f46a969224200a0a97f29cfd4c50e7534e4b4826bd23ea2c3c533039c82c" +checksum = "cd066d0b4ef8ecb03a55319dc13aa6910616d0f44008a045bb1835af830abff5" dependencies = [ "flate2", "futures-core", @@ -304,7 +299,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.66", ] [[package]] @@ -326,7 +321,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.66", ] [[package]] @@ -337,7 +332,7 @@ checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.66", ] [[package]] @@ -391,9 +386,9 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "autocfg" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "axum" @@ -408,7 +403,7 @@ dependencies = [ "futures-util", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.28", + "hyper 0.14.29", "itoa", "matchit", "memchr", @@ -437,7 +432,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.0", "http-body-util", - "hyper 1.2.0", + "hyper 1.3.1", "hyper-util", "itoa", "matchit", @@ -451,7 +446,7 @@ dependencies = [ "serde_path_to_error", "serde_urlencoded", "sha1", - "sync_wrapper 1.0.0", + "sync_wrapper 1.0.1", "tokio", "tokio-tungstenite 0.21.0", "tower", @@ -507,14 +502,14 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.66", ] [[package]] name = "backtrace" -version = "0.3.71" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", @@ -596,7 +591,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.55", + "syn 2.0.66", "which", ] @@ -654,7 +649,7 @@ checksum = "e0b121a9fe0df916e362fb3271088d071159cdf11db0e4182d02152850756eff" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.66", ] [[package]] @@ -680,7 +675,7 @@ dependencies = [ "hex", "http 1.1.0", "http-body-util", - "hyper 1.2.0", + "hyper 1.3.1", "hyper-named-pipe", "hyper-util", "hyperlocal-next", @@ -752,9 +747,9 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "4.0.0" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6221fe77a248b9117d431ad93761222e1cf8ff282d9d1d5d9f53d6299a1cf76" +checksum = "9a45bd2e4095a8b518033b128020dd4a55aab1c0a381ba4404a472630f4bc362" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -762,9 +757,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.15.4" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "by_address" @@ -780,9 +775,9 @@ checksum = "11aade7a05aa8c3a351cedc44c3fc45806430543382fcc4743a9b757a2a0b4ed" [[package]] name = "bytemuck" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d6d68c57235a3a081186990eca2867354726650f42f7516ca50c28d6281fd15" +checksum = "78834c15cb5d5efe3452d58b1e8ba890dd62d21907f867f383358198e56ebca5" [[package]] name = "byteorder" @@ -818,9 +813,9 @@ dependencies = [ [[package]] name = "caret" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d55bb9904b8ef817fd66664cba4ecacac936781105c1016b0d2e13b900218db" +checksum = "4ac3ae35de516b8ee4bfb6affc72bd6c121d2967206f307c026890f99c7875a0" [[package]] name = "cast" @@ -830,12 +825,13 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.0.90" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" +checksum = "96c51067fd44124faa7f870b4b1c969379ad32b2ba805aa959430ceaa384f695" dependencies = [ "jobserver", "libc", + "once_cell", ] [[package]] @@ -898,7 +894,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.52.4", + "windows-targets 0.52.5", ] [[package]] @@ -941,9 +937,9 @@ dependencies = [ [[package]] name = "clang-sys" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" dependencies = [ "glob", "libc", @@ -969,7 +965,7 @@ dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim 0.11.0", + "strsim 0.11.1", ] [[package]] @@ -981,14 +977,14 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.66", ] [[package]] name = "clap_lex" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" +checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" [[package]] name = "clash" @@ -1045,7 +1041,7 @@ dependencies = [ "hmac", "http 1.1.0", "httparse", - "hyper 0.14.28", + "hyper 0.14.29", "hyper-rustls", "ip_network_table-deps-treebitmap", "ipnet", @@ -1055,6 +1051,7 @@ dependencies = [ "md-5", "mockall", "murmur3", + "netdev", "netstack-lwip", "network-interface", "once_cell", @@ -1119,15 +1116,15 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" [[package]] name = "concurrent-queue" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" dependencies = [ "crossbeam-utils", ] @@ -1281,9 +1278,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.12" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" dependencies = [ "crossbeam-utils", ] @@ -1318,9 +1315,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crunchy" @@ -1358,7 +1355,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" dependencies = [ "quote", - "syn 2.0.55", + "syn 2.0.66", ] [[package]] @@ -1395,7 +1392,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.66", ] [[package]] @@ -1410,12 +1407,12 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.8" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" +checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" dependencies = [ - "darling_core 0.20.8", - "darling_macro 0.20.8", + "darling_core 0.20.9", + "darling_macro 0.20.9", ] [[package]] @@ -1434,16 +1431,16 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.8" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" +checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", - "strsim 0.10.0", - "syn 2.0.55", + "strsim 0.11.1", + "syn 2.0.66", ] [[package]] @@ -1459,26 +1456,26 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.8" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" +checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" dependencies = [ - "darling_core 0.20.8", + "darling_core 0.20.9", "quote", - "syn 2.0.55", + "syn 2.0.66", ] [[package]] name = "data-encoding" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" [[package]] name = "defmt" -version = "0.3.6" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3939552907426de152b3c2c6f51ed53f98f448babd26f28694c95f5906194595" +checksum = "a99dd22262668b887121d4672af5a64b238f026099f1a2a1b322066c9ecfe9e0" dependencies = [ "bitflags 1.3.2", "defmt-macros", @@ -1486,15 +1483,15 @@ dependencies = [ [[package]] name = "defmt-macros" -version = "0.3.7" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18bdc7a7b92ac413e19e95240e75d3a73a8d8e78aa24a594c22cbb4d44b4bbda" +checksum = "e3a9f309eff1f79b3ebdf252954d90ae440599c26c2c553fe87a2d17195f2dcb" dependencies = [ "defmt-parser", "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.66", ] [[package]] @@ -1508,9 +1505,9 @@ dependencies = [ [[package]] name = "der" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", "pem-rfc7468", @@ -1544,7 +1541,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c21b673a9b8c78c34908e6fcb42b922e11c4df2de5237f1c3f58d3285904a84b" dependencies = [ "heck 0.4.1", - "itertools 0.10.5", + "itertools 0.11.0", "proc-macro-crate 1.3.1", "proc-macro2", "quote", @@ -1578,7 +1575,7 @@ dependencies = [ "quote", "sha3", "strum 0.26.2", - "syn 2.0.55", + "syn 2.0.66", "void", ] @@ -1615,15 +1612,15 @@ dependencies = [ [[package]] name = "derive_more" -version = "0.99.17" +version = "0.99.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "convert_case", "proc-macro2", "quote", "rustc_version", - "syn 1.0.109", + "syn 2.0.66", ] [[package]] @@ -1697,7 +1694,18 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.66", +] + +[[package]] +name = "dlopen2" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09b4f5f101177ff01b8ec4ecc81eead416a8aa42819a2869311b3420fa114ffa" +dependencies = [ + "libc", + "once_cell", + "winapi", ] [[package]] @@ -1714,9 +1722,9 @@ checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1" [[package]] name = "downcast-rs" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" [[package]] name = "dyn-clone" @@ -1778,9 +1786,9 @@ dependencies = [ [[package]] name = "either" -version = "1.10.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" [[package]] name = "elliptic-curve" @@ -1828,7 +1836,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.66", ] [[package]] @@ -1841,7 +1849,7 @@ dependencies = [ "num-traits", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.66", ] [[package]] @@ -1862,9 +1870,9 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", @@ -1872,9 +1880,9 @@ dependencies = [ [[package]] name = "event-listener" -version = "5.2.0" +version = "5.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b5fb89194fa3cad959b833185b3063ba881dbfc7030680b314250779fb4cc91" +checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" dependencies = [ "concurrent-queue", "parking", @@ -1895,9 +1903,9 @@ checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" [[package]] name = "fastrand" -version = "2.0.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "ff" @@ -1911,15 +1919,15 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.2.7" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c007b1ae3abe1cb6f85a16305acd418b7ca6343b953633fee2b76d8f108b830f" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" [[package]] name = "figment" -version = "0.10.18" +version = "0.10.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d032832d74006f99547004d49410a4b4218e4c33382d56ca3ff89df74f86b953" +checksum = "8cb01cd46b0cf372153850f4c6c272d9cbea2da513e07538405148f95bd789f3" dependencies = [ "atomic 0.6.0", "serde", @@ -1936,15 +1944,15 @@ checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.4.1", "windows-sys 0.52.0", ] [[package]] name = "flate2" -version = "1.0.28" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" dependencies = [ "crc32fast", "miniz_oxide", @@ -1985,9 +1993,9 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "fs-mistrust" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cdd924d54176c572ca504dd6fea964a505be780be4fa0129f83c5ce6f7a9a3b" +checksum = "daa843fc37db9fe16a248421fa36454f903dbc2ff722cc613a7e12932ee572c7" dependencies = [ "derive_builder_fork_arti", "dirs", @@ -2080,7 +2088,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.66", ] [[package]] @@ -2090,7 +2098,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f2f12607f92c69b12ed746fabf9ca4f5c482cba46679c1a75b874ed7c26adb" dependencies = [ "futures-io", - "rustls 0.23.5", + "rustls 0.23.10", "rustls-pki-types", ] @@ -2146,9 +2154,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "js-sys", @@ -2169,9 +2177,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] name = "glob" @@ -2198,9 +2206,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fbd2820c5e49886948654ab546d0688ff24530286bdcf8fca3cefb16d4618eb" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" dependencies = [ "bytes", "fnv", @@ -2236,9 +2244,9 @@ dependencies = [ [[package]] name = "half" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5eceaaeec696539ddaf7b333340f1af35a5aa87ae3e4f3ead0532f72affab2e" +checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" dependencies = [ "cfg-if", "crunchy", @@ -2261,21 +2269,20 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", - "allocator-api2", ] [[package]] name = "hashlink" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692eaaf7f7607518dd3cef090f1474b61edc5301d8012f09579920df68b725ee" +checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af" dependencies = [ - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] @@ -2359,7 +2366,7 @@ dependencies = [ "futures-channel", "futures-io", "futures-util", - "h2 0.3.25", + "h2 0.3.26", "http 0.2.12", "idna 0.4.0", "ipnet", @@ -2412,7 +2419,7 @@ dependencies = [ "cfg-if", "enum-as-inner 0.6.0", "futures-util", - "h2 0.3.25", + "h2 0.3.26", "hickory-proto", "hickory-resolver", "http 0.2.12", @@ -2515,12 +2522,12 @@ dependencies = [ [[package]] name = "http-body-util" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ "bytes", - "futures-core", + "futures-util", "http 1.1.0", "http-body 1.0.0", "pin-project-lite", @@ -2528,9 +2535,9 @@ dependencies = [ [[package]] name = "http-range-header" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ce4ef31cda248bbdb6e6820603b82dfcd9e833db65a43e997a0ccec777d11fe" +checksum = "08a397c49fec283e3d6211adbe480be95aae5f304cfb923e9970e08956d5168a" [[package]] name = "httparse" @@ -2562,15 +2569,15 @@ dependencies = [ [[package]] name = "hyper" -version = "0.14.28" +version = "0.14.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "f361cde2f109281a220d4307746cdfd5ee3f410da58a70377762396775634b33" dependencies = [ "bytes", "futures-channel", "futures-core", "futures-util", - "h2 0.3.25", + "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", "httparse", @@ -2586,9 +2593,9 @@ dependencies = [ [[package]] name = "hyper" -version = "1.2.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "186548d73ac615b32a73aafe38fb4f56c0d340e110e5a200bcadbaf2e199263a" +checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" dependencies = [ "bytes", "futures-channel", @@ -2611,7 +2618,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73b7d8abf35697b81a825e386fc151e0d503e8cb5fcb93cc8669c376dfd6f278" dependencies = [ "hex", - "hyper 1.2.0", + "hyper 1.3.1", "hyper-util", "pin-project-lite", "tokio", @@ -2627,7 +2634,7 @@ checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http 0.2.12", - "hyper 0.14.28", + "hyper 0.14.29", "log", "rustls 0.21.8", "rustls-native-certs", @@ -2641,7 +2648,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" dependencies = [ - "hyper 0.14.28", + "hyper 0.14.29", "pin-project-lite", "tokio", "tokio-io-timeout", @@ -2649,16 +2656,16 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.3" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa" +checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56" dependencies = [ "bytes", "futures-channel", "futures-util", "http 1.1.0", "http-body 1.0.0", - "hyper 1.2.0", + "hyper 1.3.1", "pin-project-lite", "socket2", "tokio", @@ -2675,7 +2682,7 @@ checksum = "acf569d43fa9848e510358c07b80f4adf34084ddc28c6a4a651ee8474c070dcc" dependencies = [ "hex", "http-body-util", - "hyper 1.2.0", + "hyper 1.3.1", "hyper-util", "pin-project-lite", "tokio", @@ -2693,7 +2700,7 @@ dependencies = [ "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows-core", + "windows-core 0.52.0", ] [[package]] @@ -2820,7 +2827,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.66", ] [[package]] @@ -2880,7 +2887,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "serde", ] @@ -2991,6 +2998,12 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "is_terminal_polyfill" +version = "1.70.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" + [[package]] name = "itertools" version = "0.10.5" @@ -3000,6 +3013,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + [[package]] name = "itertools" version = "0.12.1" @@ -3017,9 +3039,9 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jobserver" -version = "0.1.28" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" +checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" dependencies = [ "libc", ] @@ -3090,7 +3112,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" dependencies = [ "cfg-if", - "windows-targets 0.52.4", + "windows-targets 0.52.5", ] [[package]] @@ -3101,13 +3123,12 @@ checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "libredox" -version = "0.0.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ "bitflags 2.5.0", "libc", - "redox_syscall", ] [[package]] @@ -3129,9 +3150,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "litemap" @@ -3141,9 +3162,9 @@ checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -3245,11 +3266,17 @@ dependencies = [ "digest", ] +[[package]] +name = "memalloc" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df39d232f5c40b0891c10216992c2f250c054105cb1e56f0fc9032db6203ecc1" + [[package]] name = "memchr" -version = "2.7.2" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memmap2" @@ -3296,9 +3323,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" dependencies = [ "adler", ] @@ -3339,7 +3366,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.66", ] [[package]] @@ -3348,6 +3375,71 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9252111cf132ba0929b6f8e030cac2a24b507f3a4d6db6fb2896f27b354c714b" +[[package]] +name = "netdev" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2efc0a21a3025c876092d3f122fabb1f0e21bc1d90465e0c980bad40fd753d" +dependencies = [ + "dlopen2", + "libc", + "memalloc", + "netlink-packet-core", + "netlink-packet-route", + "netlink-sys", + "once_cell", + "system-configuration", + "windows-sys 0.52.0", +] + +[[package]] +name = "netlink-packet-core" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72724faf704479d67b388da142b186f916188505e7e0b26719019c525882eda4" +dependencies = [ + "anyhow", + "byteorder", + "netlink-packet-utils", +] + +[[package]] +name = "netlink-packet-route" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053998cea5a306971f88580d0829e90f270f940befd7cf928da179d4187a5a66" +dependencies = [ + "anyhow", + "bitflags 1.3.2", + "byteorder", + "libc", + "netlink-packet-core", + "netlink-packet-utils", +] + +[[package]] +name = "netlink-packet-utils" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ede8a08c71ad5a95cdd0e4e52facd37190977039a4704eb82a283f713747d34" +dependencies = [ + "anyhow", + "byteorder", + "paste", + "thiserror", +] + +[[package]] +name = "netlink-sys" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "416060d346fbaf1f23f9512963e3e878f1a78e707cb699ba9215761754244307" +dependencies = [ + "bytes", + "libc", + "log", +] + [[package]] name = "netstack-lwip" version = "0.3.4" @@ -3437,11 +3529,10 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" dependencies = [ - "autocfg", "num-integer", "num-traits", ] @@ -3480,9 +3571,9 @@ dependencies = [ [[package]] name = "num-iter" -version = "0.1.44" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d869c01cc0c455284163fd0092f1f93835385ccab5a98a0dcc497b2f8bf055a9" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" dependencies = [ "autocfg", "num-integer", @@ -3491,9 +3582,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", "libm", @@ -3527,14 +3618,14 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.66", ] [[package]] name = "object" -version = "0.32.2" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" dependencies = [ "memchr", ] @@ -3736,9 +3827,9 @@ checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", @@ -3746,22 +3837,22 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.5.2", "smallvec", - "windows-targets 0.48.5", + "windows-targets 0.52.5", ] [[package]] name = "paste" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "peeking_take_while" @@ -3814,7 +3905,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.66", ] [[package]] @@ -3843,14 +3934,14 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.66", ] [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -3893,9 +3984,9 @@ checksum = "db23d408679286588f4d4644f965003d056e3dd5abcaaa938116871d7ce2fee7" [[package]] name = "plotters" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2c224ba00d7cadd4d5c660deaf2098e5e80e07846537c51f9cfa4be50c1fd45" +checksum = "a15b6eccb8484002195a3e44fe65a4ce8e93a625797a063735536fd59cb01cf3" dependencies = [ "num-traits", "plotters-backend", @@ -3906,15 +3997,15 @@ dependencies = [ [[package]] name = "plotters-backend" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e76628b4d3a7581389a35d5b6e2139607ad7c75b17aed325f210aa91f4a9609" +checksum = "414cec62c6634ae900ea1c56128dfe87cf63e7caece0852ec76aba307cebadb7" [[package]] name = "plotters-svg" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38f6d39893cca0701371e3c27294f09797214b86f1fb951b89ade8ec04e2abab" +checksum = "81b30686a7d9c3e010b84284bdd26a29f2138574f52f5eb6f794fc0ad924e705" dependencies = [ "plotters-backend", ] @@ -3997,12 +4088,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d3928fb5db768cb86f891ff014f0144589297e3c6a1aba6ed7cecfdace270c7" +checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" dependencies = [ "proc-macro2", - "syn 2.0.55", + "syn 2.0.66", ] [[package]] @@ -4069,9 +4160,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.79" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" +checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" dependencies = [ "unicode-ident", ] @@ -4096,14 +4187,14 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.66", ] [[package]] name = "prost-types" -version = "0.12.3" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "193898f59edcf43c26227dcd4c8427f00d99d61e95dcde58dabd49fa291d470e" +checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" dependencies = [ "prost", ] @@ -4198,9 +4289,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -4289,11 +4380,20 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "redox_syscall" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" +dependencies = [ + "bitflags 2.5.0", +] + [[package]] name = "redox_users" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" +checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" dependencies = [ "getrandom", "libredox", @@ -4308,8 +4408,8 @@ checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.6", - "regex-syntax 0.8.3", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", ] [[package]] @@ -4323,13 +4423,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.3", + "regex-syntax 0.8.4", ] [[package]] @@ -4340,9 +4440,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "register-count" @@ -4362,9 +4462,9 @@ dependencies = [ [[package]] name = "retry-error" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7dea0c97723329951a3ed41ce0de8b8e389de3de4b815fb86ff57f6ab868f04" +checksum = "b960f1dc847b9e4383ca73b4e8002f725b2f562addb9ade88a6ba109b305e96d" [[package]] name = "rfc6979" @@ -4463,9 +4563,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" @@ -4484,9 +4584,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.32" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ "bitflags 2.5.0", "errno", @@ -4508,15 +4608,15 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.5" +version = "0.23.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afabcee0551bd1aa3e18e5adbf2c0544722014b899adb31bd186ec638d3da97e" +checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402" dependencies = [ "log", "once_cell", "ring 0.17.8", "rustls-pki-types", - "rustls-webpki 0.102.2", + "rustls-webpki 0.102.4", "subtle", "zeroize", ] @@ -4544,9 +4644,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.4.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd36cc4259e3e4514335c4a138c6b43171a8d61d8f5c9348f9fc7529416f247" +checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" [[package]] name = "rustls-webpki" @@ -4560,9 +4660,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.2" +version = "0.102.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" +checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" dependencies = [ "ring 0.17.8", "rustls-pki-types", @@ -4571,21 +4671,21 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "ryu" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "safelog" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ea892f8598a3682b6ed10ed9d8522b50366a792953eda37e1d9ddf01e183e3f" +checksum = "4a1e9cd092ef5e122f1a34f3fe15de8e9685f8f610e31c4c0643976aa5e31737" dependencies = [ "derive_more", "educe", @@ -4615,9 +4715,9 @@ dependencies = [ [[package]] name = "scc" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec96560eea317a9cc4e0bb1f6a2c93c09a19b8c4fc5cb3fcc0ec1c094cd783e2" +checksum = "76ad2bbb0ae5100a07b7a6f2ed7ab5fd0045551a4c507989b7a620046ea3efdc" dependencies = [ "sdd", ] @@ -4692,9 +4792,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "sendfd" @@ -4733,7 +4833,7 @@ checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.66", ] [[package]] @@ -4768,20 +4868,20 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.18" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" +checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.66", ] [[package]] name = "serde_spanned" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" dependencies = [ "serde", ] @@ -4800,11 +4900,11 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.7.0" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee80b0e361bbf88fd2f6e242ccd19cfda072cb0faa6ae694ecee08199938569a" +checksum = "0ad483d2ab0149d5a5ebcd9972a3852711e0153d863bf5a5d0391d28883c4a20" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "chrono", "hex", "indexmap 1.9.3", @@ -4818,14 +4918,14 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.7.0" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6561dc161a9224638a31d876ccdfefbc1df91d3f3a8342eddb35f055d48c7655" +checksum = "65569b702f41443e8bc8bbb1c5779bd0450bbe723b56198980e80ec45780bce2" dependencies = [ - "darling 0.20.8", + "darling 0.20.9", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.66", ] [[package]] @@ -4863,7 +4963,7 @@ checksum = "82fe9db325bcef1fbcde82e078a5cc4efdf787e96b3b9cf45b50b529f2083d67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.66", ] [[package]] @@ -4900,9 +5000,9 @@ dependencies = [ [[package]] name = "shadowsocks" -version = "1.19.1" +version = "1.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51fa6f002adf82171d1de0308bcbf31ecd1d66f5ce70357e285aa21c07a32db3" +checksum = "62417db1fe22423c0d28ce6a88f7386baa52e202a30789f171af27b81c206b97" dependencies = [ "aes", "arc-swap", @@ -4938,9 +5038,9 @@ dependencies = [ [[package]] name = "shadowsocks-crypto" -version = "0.5.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65da645ff4a6440ba1b52a9d6b4c8792054860ac135cb87f8ad3d2c7a78d41b5" +checksum = "a9e49ecfad8b27f3df28848af11f08aa10df0c6b74b45748131753913be23373" dependencies = [ "aes", "aes-gcm", @@ -4981,9 +5081,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] @@ -5113,9 +5213,9 @@ dependencies = [ [[package]] name = "ssh-key" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b71299a724c8d84956caaf8fc3b3ea57c3587fe2d0b800cd0dc1f3599905d7e" +checksum = "ca9b366a80cf18bb6406f4cf4d10aebfb46140a8c0c33f666a144c5c76ecbafc" dependencies = [ "p256", "p384", @@ -5151,9 +5251,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "strsim" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" @@ -5170,7 +5270,7 @@ version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" dependencies = [ - "strum_macros 0.26.2", + "strum_macros 0.26.4", ] [[package]] @@ -5183,20 +5283,20 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.55", + "syn 2.0.66", ] [[package]] name = "strum_macros" -version = "0.26.2" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "proc-macro2", "quote", "rustversion", - "syn 2.0.55", + "syn 2.0.66", ] [[package]] @@ -5218,9 +5318,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.55" +version = "2.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "002a1b3dbf967edfafc32655d0f377ab0bb7b994aa1d32c8cc7e9b8bf3ebb8f0" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" dependencies = [ "proc-macro2", "quote", @@ -5235,9 +5335,9 @@ checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" [[package]] name = "sync_wrapper" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "384595c11a4e2969895cad5a8c4029115f5ab956a9e5ef4de79d11a426e5f20c" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" [[package]] name = "synstructure" @@ -5247,7 +5347,28 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.66", +] + +[[package]] +name = "system-configuration" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "658bc6ee10a9b4fcf576e9b0819d95ec16f4d2c02d39fd83ac1c8789785c4a42" +dependencies = [ + "bitflags 2.5.0", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +dependencies = [ + "core-foundation-sys", + "libc", ] [[package]] @@ -5291,7 +5412,7 @@ checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.66", ] [[package]] @@ -5328,9 +5449,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.34" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", @@ -5349,9 +5470,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ "num-conv", "time-core", @@ -5359,9 +5480,9 @@ dependencies = [ [[package]] name = "tinystr" -version = "0.7.5" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83c02bf3c538ab32ba913408224323915f4ef9a6d61c0e85d493f355921c0ece" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" dependencies = [ "displaydoc", "zerovec", @@ -5430,7 +5551,7 @@ checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.66", ] [[package]] @@ -5523,21 +5644,21 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.12" +version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" +checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.9", + "toml_edit 0.22.14", ] [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" dependencies = [ "serde", ] @@ -5566,15 +5687,15 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.9" +version = "0.22.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e40bb779c5187258fd7aad0eb68cb8706a0a81fa712fbea808ab43c4b8374c4" +checksum = "f21c7aaf97f1bd9ca9d4f9e73b0a6c74bd5afef56f2bc931943a6e1c37e04e38" dependencies = [ "indexmap 2.2.6", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.5", + "winnow 0.6.13", ] [[package]] @@ -5588,10 +5709,10 @@ dependencies = [ "axum 0.6.20", "base64 0.21.7", "bytes", - "h2 0.3.25", + "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.28", + "hyper 0.14.29", "hyper-timeout", "percent-encoding", "pin-project", @@ -6457,7 +6578,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.66", ] [[package]] @@ -6534,11 +6655,10 @@ dependencies = [ [[package]] name = "tracing-test" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a2c0ff408fe918a94c428a3f2ad04e4afd5c95bbc08fcf868eff750c15728a4" +checksum = "557b891436fe0d5e0e363427fc7f217abf9ccd510d5136549847bdcbcd011d68" dependencies = [ - "lazy_static", "tracing-core", "tracing-subscriber", "tracing-test-macro", @@ -6546,13 +6666,12 @@ dependencies = [ [[package]] name = "tracing-test-macro" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "258bc1c4f8e2e73a977812ab339d503e6feeb92700f6d07a6de4d321522d5c08" +checksum = "04659ddb06c87d233c566112c1c9c5b9e98256d9af50ec3bc9c8327f873a7568" dependencies = [ - "lazy_static", "quote", - "syn 1.0.109", + "syn 2.0.66", ] [[package]] @@ -6799,9 +6918,9 @@ checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" @@ -6823,7 +6942,7 @@ checksum = "9881bea7cbe687e36c9ab3b778c36cd0487402e270304e8b1296d5085303c1a2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.66", ] [[package]] @@ -6852,7 +6971,7 @@ checksum = "b3fd98999db9227cf28e59d83e1f120f42bc233d4b152e8fab9bc87d5bb1e0f8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.66", ] [[package]] @@ -6922,7 +7041,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.66", "wasm-bindgen-shared", ] @@ -6944,7 +7063,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.66", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -7001,9 +7120,9 @@ dependencies = [ [[package]] name = "widestring" -version = "1.0.2" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8" +checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311" [[package]] name = "winapi" @@ -7023,11 +7142,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.6" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" dependencies = [ - "winapi", + "windows-sys 0.52.0", ] [[package]] @@ -7042,7 +7161,7 @@ version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" dependencies = [ - "windows-core", + "windows-core 0.51.1", "windows-targets 0.48.5", ] @@ -7055,6 +7174,15 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.5", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -7070,7 +7198,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.5", ] [[package]] @@ -7090,17 +7218,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "windows_aarch64_gnullvm 0.52.4", - "windows_aarch64_msvc 0.52.4", - "windows_i686_gnu 0.52.4", - "windows_i686_msvc 0.52.4", - "windows_x86_64_gnu 0.52.4", - "windows_x86_64_gnullvm 0.52.4", - "windows_x86_64_msvc 0.52.4", + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] [[package]] @@ -7111,9 +7240,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" @@ -7123,9 +7252,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" @@ -7135,9 +7264,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.4" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" @@ -7147,9 +7282,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" @@ -7159,9 +7294,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" @@ -7171,9 +7306,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" @@ -7183,9 +7318,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winnow" @@ -7198,9 +7333,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.5" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dffa400e67ed5a4dd237983829e66475f0a4a26938c4b04c21baede6262215b8" +checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1" dependencies = [ "memchr", ] @@ -7300,28 +7435,28 @@ checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.66", "synstructure", ] [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.66", ] [[package]] @@ -7341,15 +7476,15 @@ checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.66", "synstructure", ] [[package]] name = "zeroize" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" dependencies = [ "zeroize_derive", ] @@ -7362,7 +7497,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.66", ] [[package]] @@ -7384,7 +7519,7 @@ checksum = "97cf56601ee5052b4417d90c8755c6683473c926039908196cf35d99f893ebe7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.66", ] [[package]] diff --git a/bench/README.md b/bench/README.md new file mode 100644 index 000000000..f9b334bcd --- /dev/null +++ b/bench/README.md @@ -0,0 +1,70 @@ +## To get a flamegraph + +``` +cargo flamegraph --root -- -d ./clash/tests/data/config/ -f rules.yaml +``` + +_adjust args on your own_ + + +## An example + +### Environment + +* client - Debian 12.5 running inside Hyper-V on i9-9900KF and 64GB mem +* server - DS1821+ +* connection - 10 Gig cabled + +### Direct connect + +``` +~ » iperf3 -c dsm +Connecting to host dsm, port 5201 +[ 5] local 10.0.0.14 port 40148 connected to 10.0.0.11 port 5201 +[ ID] Interval Transfer Bitrate Retr Cwnd +[ 5] 0.00-1.00 sec 1.03 GBytes 8.87 Gbits/sec 0 3.09 MBytes +[ 5] 1.00-2.00 sec 1.05 GBytes 9.06 Gbits/sec 0 3.09 MBytes +[ 5] 2.00-3.00 sec 1.09 GBytes 9.37 Gbits/sec 0 3.09 MBytes +[ 5] 3.00-4.00 sec 1.04 GBytes 8.90 Gbits/sec 0 3.09 MBytes +[ 5] 4.00-5.00 sec 1.06 GBytes 9.07 Gbits/sec 0 3.09 MBytes +[ 5] 5.00-6.00 sec 1.04 GBytes 8.93 Gbits/sec 0 3.09 MBytes +[ 5] 6.00-7.00 sec 1.05 GBytes 9.00 Gbits/sec 0 3.09 MBytes +[ 5] 7.00-8.00 sec 1.08 GBytes 9.24 Gbits/sec 0 3.09 MBytes +[ 5] 8.00-9.00 sec 1.07 GBytes 9.15 Gbits/sec 0 3.09 MBytes +[ 5] 9.00-10.00 sec 1.05 GBytes 9.02 Gbits/sec 0 3.09 MBytes +- - - - - - - - - - - - - - - - - - - - - - - - - +[ ID] Interval Transfer Bitrate Retr +[ 5] 0.00-10.00 sec 10.5 GBytes 9.06 Gbits/sec 0 sender +[ 5] 0.00-10.00 sec 10.5 GBytes 9.05 Gbits/sec receiver + +iperf Done. +-------------- +``` + +### Connect via tun + + +``` +~ » iperf3 -c dsm +Connecting to host dsm, port 5201 +[ 5] local 10.0.0.14 port 41436 connected to 10.0.0.11 port 5201 +[ ID] Interval Transfer Bitrate Retr Cwnd +[ 5] 0.00-1.00 sec 234 MBytes 1.96 Gbits/sec 1 47.1 KBytes +[ 5] 1.00-2.00 sec 235 MBytes 1.97 Gbits/sec 0 47.1 KBytes +[ 5] 2.00-3.00 sec 243 MBytes 2.04 Gbits/sec 0 47.1 KBytes +[ 5] 3.00-4.00 sec 239 MBytes 2.00 Gbits/sec 0 47.1 KBytes +[ 5] 4.00-5.00 sec 240 MBytes 2.02 Gbits/sec 0 47.1 KBytes +[ 5] 5.00-6.00 sec 238 MBytes 1.99 Gbits/sec 0 47.1 KBytes +[ 5] 6.00-7.00 sec 235 MBytes 1.97 Gbits/sec 0 47.1 KBytes +[ 5] 7.00-8.00 sec 233 MBytes 1.95 Gbits/sec 0 47.1 KBytes +[ 5] 8.00-9.00 sec 236 MBytes 1.98 Gbits/sec 0 47.1 KBytes +[ 5] 9.00-10.00 sec 241 MBytes 2.03 Gbits/sec 0 47.1 KBytes +- - - - - - - - - - - - - - - - - - - - - - - - - +[ ID] Interval Transfer Bitrate Retr +[ 5] 0.00-10.00 sec 2.32 GBytes 1.99 Gbits/sec 1 sender +[ 5] 0.00-10.00 sec 2.32 GBytes 1.99 Gbits/sec receiver + +iperf Done. +``` + +There should be room for the performance improve. diff --git a/bench/flamegraph.svg b/bench/flamegraph.svg new file mode 100644 index 000000000..811330760 --- /dev/null +++ b/bench/flamegraph.svg @@ -0,0 +1,491 @@ +Flame Graph Reset ZoomSearch [clash] (2 samples, 0.02%)[clash] (2 samples, 0.02%)[clash] (2 samples, 0.02%)[clash] (4 samples, 0.03%)[clash] (4 samples, 0.03%)[clash] (4 samples, 0.03%)read (2 samples, 0.02%)entry_SYSCALL_64_after_hwframe (2 samples, 0.02%)do_syscall_64 (2 samples, 0.02%)ksys_read (2 samples, 0.02%)vfs_read (2 samples, 0.02%)filemap_read (2 samples, 0.02%)copy_page_to_iter (2 samples, 0.02%)_copy_to_iter (2 samples, 0.02%)copy_user_enhanced_fast_string (2 samples, 0.02%)clash (5 samples, 0.04%)[unknown] (5 samples, 0.04%)[clash] (5 samples, 0.04%)[clash] (5 samples, 0.04%)[clash] (5 samples, 0.04%)[clash] (5 samples, 0.04%)[clash] (2 samples, 0.02%)[clash] (2 samples, 0.02%)[clash] (47 samples, 0.37%)[clash] (12 samples, 0.10%)[libc.so.6] (11 samples, 0.09%)[clash] (116 samples, 0.92%)[clash] (93 samples, 0.74%)malloc (22 samples, 0.18%)[clash] (196 samples, 1.56%)asm_sysvec_hyperv_callback (2 samples, 0.02%)sysvec_hyperv_callback (2 samples, 0.02%)__irq_exit_rcu (2 samples, 0.02%)__softirqentry_text_start (2 samples, 0.02%)[clash] (333 samples, 2.65%)[c..asm_sysvec_hyperv_callback (2 samples, 0.02%)sysvec_hyperv_callback (2 samples, 0.02%)__irq_exit_rcu (2 samples, 0.02%)__softirqentry_text_start (2 samples, 0.02%)[libc.so.6] (8 samples, 0.06%)[clash] (598 samples, 4.76%)[clash]malloc (119 samples, 0.95%)[libc.so.6] (84 samples, 0.67%)asm_sysvec_hyperv_callback (2 samples, 0.02%)sysvec_hyperv_callback (2 samples, 0.02%)__irq_exit_rcu (2 samples, 0.02%)__softirqentry_text_start (2 samples, 0.02%)net_rx_action (2 samples, 0.02%)__napi_poll (2 samples, 0.02%)netvsc_poll (2 samples, 0.02%)net_rx_action (3 samples, 0.02%)__napi_poll (3 samples, 0.02%)netvsc_poll (3 samples, 0.02%)napi_complete_done (3 samples, 0.02%)netif_receive_skb_list_internal (3 samples, 0.02%)__netif_receive_skb_list_core (3 samples, 0.02%)ip_list_rcv (2 samples, 0.02%)ip_sublist_rcv (2 samples, 0.02%)ip_sublist_rcv_finish (2 samples, 0.02%)ip_local_deliver_finish (2 samples, 0.02%)ip_protocol_deliver_rcu (2 samples, 0.02%)tcp_v4_rcv (2 samples, 0.02%)asm_sysvec_hyperv_callback (8 samples, 0.06%)sysvec_hyperv_callback (8 samples, 0.06%)__irq_exit_rcu (8 samples, 0.06%)__softirqentry_text_start (8 samples, 0.06%)clock_gettime (7 samples, 0.06%)__vdso_clock_gettime (3 samples, 0.02%)[[vdso]] (2 samples, 0.02%)[libc.so.6] (3 samples, 0.02%)[clash] (831 samples, 6.62%)[clash]malloc (60 samples, 0.48%)[libc.so.6] (39 samples, 0.31%)[libc.so.6] (36 samples, 0.29%)asm_sysvec_hyperv_callback (9 samples, 0.07%)sysvec_hyperv_callback (9 samples, 0.07%)__irq_exit_rcu (9 samples, 0.07%)__softirqentry_text_start (9 samples, 0.07%)net_rx_action (4 samples, 0.03%)__napi_poll (4 samples, 0.03%)netvsc_poll (4 samples, 0.03%)napi_complete_done (4 samples, 0.03%)netif_receive_skb_list_internal (4 samples, 0.03%)__netif_receive_skb_list_core (4 samples, 0.03%)ip_list_rcv (3 samples, 0.02%)ip_sublist_rcv (3 samples, 0.02%)ip_sublist_rcv_finish (3 samples, 0.02%)ip_local_deliver_finish (3 samples, 0.02%)ip_protocol_deliver_rcu (3 samples, 0.02%)tcp_v4_rcv (3 samples, 0.02%)tcp_v4_do_rcv (2 samples, 0.02%)tcp_rcv_established (2 samples, 0.02%)clock_gettime (3 samples, 0.02%)__vdso_clock_gettime (3 samples, 0.02%)[[vdso]] (3 samples, 0.02%)malloc (43 samples, 0.34%)[libc.so.6] (36 samples, 0.29%)[libc.so.6] (9 samples, 0.07%)[libc.so.6] (2 samples, 0.02%)[libc.so.6] (28 samples, 0.22%)asm_sysvec_hyperv_callback (2 samples, 0.02%)sysvec_hyperv_callback (2 samples, 0.02%)__irq_exit_rcu (2 samples, 0.02%)__softirqentry_text_start (2 samples, 0.02%)__rcu_read_lock (3 samples, 0.02%)__fdget_pos (34 samples, 0.27%)__fget_light (34 samples, 0.27%)fput (13 samples, 0.10%)__fsnotify_parent (16 samples, 0.13%)asm_sysvec_hyperv_callback (3 samples, 0.02%)sysvec_hyperv_callback (3 samples, 0.02%)__irq_exit_rcu (3 samples, 0.02%)__softirqentry_text_start (3 samples, 0.02%)__get_task_ioprio (8 samples, 0.06%)asm_sysvec_hyperv_callback (3 samples, 0.02%)sysvec_hyperv_callback (3 samples, 0.02%)__irq_exit_rcu (3 samples, 0.02%)__softirqentry_text_start (3 samples, 0.02%)__tcp_transmit_skb (2 samples, 0.02%)__ip_queue_xmit (2 samples, 0.02%)ip_finish_output2 (2 samples, 0.02%)__dev_queue_xmit (2 samples, 0.02%)sch_direct_xmit (2 samples, 0.02%)dev_hard_start_xmit (2 samples, 0.02%)netvsc_xmit (2 samples, 0.02%)__tcp_push_pending_frames (3 samples, 0.02%)tcp_write_xmit (3 samples, 0.02%)__kfree_skb (3 samples, 0.02%)skb_release_data (3 samples, 0.02%)tcp_ack (6 samples, 0.05%)tcp_data_queue (2 samples, 0.02%)napi_complete_done (20 samples, 0.16%)netif_receive_skb_list_internal (20 samples, 0.16%)__netif_receive_skb_list_core (20 samples, 0.16%)ip_list_rcv (18 samples, 0.14%)ip_sublist_rcv (18 samples, 0.14%)ip_sublist_rcv_finish (14 samples, 0.11%)ip_local_deliver_finish (14 samples, 0.11%)ip_protocol_deliver_rcu (14 samples, 0.11%)tcp_v4_rcv (14 samples, 0.11%)tcp_v4_do_rcv (13 samples, 0.10%)tcp_rcv_established (13 samples, 0.10%)napi_consume_skb (2 samples, 0.02%)__napi_alloc_skb (2 samples, 0.02%)__alloc_pages (2 samples, 0.02%)netvsc_recv_callback (3 samples, 0.02%)rndis_filter_receive (5 samples, 0.04%)net_rx_action (30 samples, 0.24%)__napi_poll (30 samples, 0.24%)netvsc_poll (30 samples, 0.24%)send_recv_completions (2 samples, 0.02%)__local_bh_enable_ip (40 samples, 0.32%)do_softirq.part.0 (37 samples, 0.29%)__softirqentry_text_start (37 samples, 0.29%)tasklet_action_common.constprop.0 (4 samples, 0.03%)tcp_tasklet_func (3 samples, 0.02%)tcp_tsq_handler (2 samples, 0.02%)tcp_write_xmit (2 samples, 0.02%)__rcu_read_lock (3 samples, 0.02%)__rcu_read_unlock (2 samples, 0.02%)__rcu_read_lock (2 samples, 0.02%)net_rx_action (2 samples, 0.02%)__skb_flow_dissect (49 samples, 0.39%)asm_sysvec_hyperv_callback (3 samples, 0.02%)sysvec_hyperv_callback (3 samples, 0.02%)__irq_exit_rcu (3 samples, 0.02%)__softirqentry_text_start (3 samples, 0.02%)__netif_receive_skb_core.constprop.0 (44 samples, 0.35%)__rcu_read_unlock (5 samples, 0.04%)raw_local_deliver (5 samples, 0.04%)__skb_checksum_complete (21 samples, 0.17%)__skb_checksum (12 samples, 0.10%)csum_partial (8 samples, 0.06%)_raw_spin_lock (11 samples, 0.09%)__pv_queued_spin_lock_slowpath (5 samples, 0.04%)_raw_spin_unlock (8 samples, 0.06%)__raw_callee_save___pv_queued_spin_unlock (7 samples, 0.06%)nf_conntrack_put (3 samples, 0.02%)__rcu_read_lock (2 samples, 0.02%)__rcu_read_unlock (5 samples, 0.04%)apparmor_socket_sock_rcv_skb (7 samples, 0.06%)sk_filter_trim_cap (42 samples, 0.33%)security_sock_rcv_skb (20 samples, 0.16%)bpf_lsm_socket_sock_rcv_skb (4 samples, 0.03%)sock_put (6 samples, 0.05%)skb_release_data (4 samples, 0.03%)kfree (2 samples, 0.02%)kfree_skb_partial (6 samples, 0.05%)skb_release_head_state (2 samples, 0.02%)kmem_cache_free (4 samples, 0.03%)tcp_add_backlog (16 samples, 0.13%)skb_try_coalesce (2 samples, 0.02%)tcp_filter (3 samples, 0.02%)tcp_inbound_md5_hash (9 samples, 0.07%)tcp_parse_md5sig_option (3 samples, 0.02%)ipv4_dst_check (5 samples, 0.04%)ip_skb_dst_mtu (4 samples, 0.03%)__ip_finish_output (15 samples, 0.12%)skb_gso_validate_network_len (8 samples, 0.06%)skb_gso_transport_seglen (6 samples, 0.05%)__rcu_read_lock (2 samples, 0.02%)__sk_dst_check (3 samples, 0.02%)__local_bh_enable_ip (4 samples, 0.03%)__qdisc_run (11 samples, 0.09%)fq_codel_dequeue (6 samples, 0.05%)_raw_spin_lock (3 samples, 0.02%)_raw_spin_unlock (2 samples, 0.02%)__raw_callee_save___pv_queued_spin_unlock (2 samples, 0.02%)netdev_core_pick_tx (3 samples, 0.02%)_raw_spin_lock (4 samples, 0.03%)_raw_spin_unlock (3 samples, 0.02%)__raw_callee_save___pv_queued_spin_unlock (3 samples, 0.02%)__rcu_read_lock (5 samples, 0.04%)__rcu_read_unlock (3 samples, 0.02%)_raw_spin_lock (8 samples, 0.06%)_raw_spin_unlock (13 samples, 0.10%)__raw_callee_save___pv_queued_spin_unlock (11 samples, 0.09%)sk_free (7 samples, 0.06%)skb_clone_tx_timestamp (4 samples, 0.03%)_raw_spin_lock_irqsave (7 samples, 0.06%)__wake_up_common_lock (1,262 samples, 10.06%)__wake_up_commo.._raw_spin_unlock_irqrestore (1,251 samples, 9.97%)_raw_spin_unlo..sock_def_readable (1,274 samples, 10.15%)sock_def_readab..__wake_up_sync_key (2 samples, 0.02%)dev_hard_start_xmit (1,367 samples, 10.89%)dev_hard_start_x..tun_net_xmit (1,357 samples, 10.81%)tun_net_xmittcp_wfree (17 samples, 0.14%)__rcu_read_lock (5 samples, 0.04%)ip_send_check (8 samples, 0.06%)tcp4_gso_segment (3 samples, 0.02%)csum_partial (8 samples, 0.06%)__build_skb_around (7 samples, 0.06%)___slab_alloc (6 samples, 0.05%)__kmem_cache_alloc_node (36 samples, 0.29%)memset_erms (16 samples, 0.13%)__kmalloc_node_track_caller (44 samples, 0.35%)kmalloc_slab (4 samples, 0.03%)kmalloc_reserve (50 samples, 0.40%)kmalloc_size_roundup (2 samples, 0.02%)memset_erms (18 samples, 0.14%)__alloc_skb (103 samples, 0.82%)kmem_cache_alloc_node (32 samples, 0.25%)__copy_skb_header (37 samples, 0.29%)__skb_checksum (124 samples, 0.99%)csum_partial (110 samples, 0.88%)memcpy_erms (16 samples, 0.13%)skb_headers_offset_update (2 samples, 0.02%)skb_network_protocol (2 samples, 0.02%)__skb_gso_segment (412 samples, 3.28%)__s..skb_mac_gso_segment (406 samples, 3.24%)skb..inet_gso_segment (397 samples, 3.16%)ine..tcp_gso_segment (376 samples, 3.00%)tcp..skb_segment (354 samples, 2.82%)sk..netif_skb_features (13 samples, 0.10%)validate_xmit_skb (431 samples, 3.43%)val..skb_checksum_help (2 samples, 0.02%)__dev_queue_xmit (1,859 samples, 14.81%)__dev_queue_xmitsch_direct_xmit (1,819 samples, 14.49%)sch_direct_xmitvalidate_xmit_skb_list (439 samples, 3.50%)val..validate_xmit_xfrm (5 samples, 0.04%)ip_finish_output2 (1,882 samples, 15.00%)ip_finish_output2neigh_connected_output (8 samples, 0.06%)ip_local_out (5 samples, 0.04%)__ip_local_out (4 samples, 0.03%)__ip_queue_xmit (1,938 samples, 15.44%)__ip_queue_xmitip_output (17 samples, 0.14%)nf_hook_slow (6 samples, 0.05%)apparmor_ip_postroute (3 samples, 0.02%)__skb_clone (6 samples, 0.05%)__copy_skb_header (4 samples, 0.03%)__tcp_select_window (4 samples, 0.03%)bpf_skops_write_hdr_opt.isra.0 (5 samples, 0.04%)skb_clone (5 samples, 0.04%)tcp_established_options (2 samples, 0.02%)tcp_options_write (3 samples, 0.02%)__list_add_valid (3 samples, 0.02%)tcp_update_skb_after_send (8 samples, 0.06%)__list_del_entry_valid (4 samples, 0.03%)__tcp_transmit_skb (2,004 samples, 15.97%)__tcp_transmit_skbread_hv_clock_tsc (7 samples, 0.06%)ktime_get (14 samples, 0.11%)skb_split (10 samples, 0.08%)tcp_check_space (8 samples, 0.06%)rb_insert_color (3 samples, 0.02%)sk_reset_timer (3 samples, 0.02%)__mod_timer (2 samples, 0.02%)tcp_event_new_data_sent (20 samples, 0.16%)tcp_rbtree_insert (4 samples, 0.03%)tcp_schedule_loss_probe (3 samples, 0.02%)___slab_alloc (3 samples, 0.02%)__kmalloc_node_track_caller (12 samples, 0.10%)__kmem_cache_alloc_node (11 samples, 0.09%)memset_erms (5 samples, 0.04%)kmalloc_reserve (15 samples, 0.12%)kmalloc_size_roundup (2 samples, 0.02%)__alloc_skb (27 samples, 0.22%)kmem_cache_alloc_node (7 samples, 0.06%)mod_memcg_state (3 samples, 0.02%)mem_cgroup_charge_skmem (5 samples, 0.04%)tcp_stream_alloc_skb (39 samples, 0.31%)__tcp_push_pending_frames (2,166 samples, 17.26%)__tcp_push_pending_framestcp_write_xmit (2,158 samples, 17.20%)tcp_write_xmittcp_tso_segs (8 samples, 0.06%)__kmem_cache_free (3 samples, 0.02%)__slab_free (12 samples, 0.10%)cmpxchg_double_slab.constprop.0.isra.0 (4 samples, 0.03%)free_pcp_prepare (3 samples, 0.02%)free_unref_page (4 samples, 0.03%)kfree (4 samples, 0.03%)__kfree_skb (29 samples, 0.23%)skb_release_data (29 samples, 0.23%)mem_cgroup_uncharge_skmem (2 samples, 0.02%)mod_memcg_state (2 samples, 0.02%)__sk_mem_reduce_allocated (7 samples, 0.06%)refill_stock (5 samples, 0.04%)__slab_free (8 samples, 0.06%)cmpxchg_double_slab.constprop.0.isra.0 (4 samples, 0.03%)cubictcp_acked (4 samples, 0.03%)cubictcp_cong_avoid (3 samples, 0.02%)kmem_cache_free (5 samples, 0.04%)cache_from_obj (2 samples, 0.02%)rb_erase (12 samples, 0.10%)rb_first (6 samples, 0.05%)rb_next (2 samples, 0.02%)__mod_timer (5 samples, 0.04%)sk_reset_timer (7 samples, 0.06%)tcp_ack_tstamp (2 samples, 0.02%)tcp_ack_update_rtt (15 samples, 0.12%)minmax_running_min (6 samples, 0.05%)tcp_newly_delivered (5 samples, 0.04%)tcp_rack_update_reo_wnd (13 samples, 0.10%)tcp_rate_gen (3 samples, 0.02%)tcp_rate_skb_delivered (6 samples, 0.05%)tcp_rearm_rto (6 samples, 0.05%)tcp_schedule_loss_probe (4 samples, 0.03%)PageHeadHuge (2 samples, 0.02%)__folio_put (5 samples, 0.04%)_raw_spin_trylock (2 samples, 0.02%)__pskb_trim_head (25 samples, 0.20%)free_unref_page (10 samples, 0.08%)free_pcp_prepare (5 samples, 0.04%)mem_cgroup_uncharge_skmem (3 samples, 0.02%)mod_memcg_state (3 samples, 0.02%)tcp_trim_head (49 samples, 0.39%)__sk_mem_reduce_allocated (9 samples, 0.07%)refill_stock (3 samples, 0.02%)tcp_ack (294 samples, 2.34%)t..tcp_update_pacing_rate (17 samples, 0.14%)sk_stream_write_space (221 samples, 1.76%)__wake_up_common_lock (219 samples, 1.75%)_raw_spin_unlock_irqrestore (219 samples, 1.75%)tcp_check_space (244 samples, 1.94%)t..tcp_sndbuf_expand (2 samples, 0.02%)ipv4_mtu (7 samples, 0.06%)tcp_current_mss (20 samples, 0.16%)tcp_established_options (3 samples, 0.02%)__kmem_cache_free (12 samples, 0.10%)kfree (13 samples, 0.10%)skb_release_data (31 samples, 0.25%)__kfree_skb (41 samples, 0.33%)skb_release_head_state (7 samples, 0.06%)kfree_skbmem (6 samples, 0.05%)tcp_data_queue (84 samples, 0.67%)kmem_cache_free (30 samples, 0.24%)cache_from_obj (12 samples, 0.10%)read_hv_clock_tsc (20 samples, 0.16%)tcp_mstamp_refresh (41 samples, 0.33%)ktime_get (35 samples, 0.28%)read_hv_clock_tsc_cs (2 samples, 0.02%)tcp_urg (3 samples, 0.02%)tcp_v4_do_rcv (2,892 samples, 23.04%)tcp_v4_do_rcvtcp_rcv_established (2,880 samples, 22.95%)tcp_rcv_establishedtcp_validate_incoming (17 samples, 0.14%)ip_local_deliver_finish (3,085 samples, 24.58%)ip_local_deliver_finiship_protocol_deliver_rcu (3,076 samples, 24.51%)ip_protocol_deliver_rcutcp_v4_rcv (3,060 samples, 24.38%)tcp_v4_rcvtcp_v4_fill_cb (6 samples, 0.05%)ip_rcv_core (77 samples, 0.61%)sock_wfree (56 samples, 0.45%)tun_sock_write_space (18 samples, 0.14%)__inet_lookup_established (34 samples, 0.27%)inet_ehashfn (4 samples, 0.03%)__netif_receive_skb_one_core (3,289 samples, 26.21%)__netif_receive_skb_one_coreip_rcv (149 samples, 1.19%)ip_rcv_finish_core.constprop.0 (66 samples, 0.53%)tcp_v4_early_demux (48 samples, 0.38%)__rcu_read_lock (4 samples, 0.03%)netif_receive_skb (3,308 samples, 26.36%)netif_receive_skbskb_defer_rx_timestamp (3 samples, 0.02%)__check_heap_object (12 samples, 0.10%)__virt_addr_valid (26 samples, 0.21%)__check_object_size (54 samples, 0.43%)check_stack_object (2 samples, 0.02%)skb_copy_datagram_from_iter (89 samples, 0.71%)_copy_from_iter (33 samples, 0.26%)copy_user_short_string (17 samples, 0.14%)skb_put (2 samples, 0.02%)__kmem_cache_alloc_node (47 samples, 0.37%)memset_erms (13 samples, 0.10%)__kmalloc_node_track_caller (52 samples, 0.41%)kmalloc_slab (2 samples, 0.02%)kmalloc_reserve (75 samples, 0.60%)kmalloc_size_roundup (18 samples, 0.14%)kmalloc_slab (9 samples, 0.07%)memcg_slab_post_alloc_hook (3 samples, 0.02%)memset_erms (18 samples, 0.14%)alloc_skb_with_frags (149 samples, 1.19%)__alloc_skb (144 samples, 1.15%)kmem_cache_alloc_node (55 samples, 0.44%)should_failslab (2 samples, 0.02%)sock_alloc_send_pskb (186 samples, 1.48%)skb_set_owner_w (20 samples, 0.16%)do_iter_readv_writev (3,822 samples, 30.45%)do_iter_readv_writevtun_chr_write_iter (3,791 samples, 30.21%)tun_chr_write_itertun_get_user (3,764 samples, 29.99%)tun_get_uservirtio_net_hdr_to_skb.constprop.0 (9 samples, 0.07%)rw_verify_area (4 samples, 0.03%)apparmor_file_permission (36 samples, 0.29%)aa_file_perm (7 samples, 0.06%)do_iter_write (3,921 samples, 31.24%)do_iter_writesecurity_file_permission (51 samples, 0.41%)__check_object_size (6 samples, 0.05%)check_stack_object (3 samples, 0.02%)copy_user_enhanced_fast_string (11 samples, 0.09%)_copy_from_user (26 samples, 0.21%)copy_user_short_string (8 samples, 0.06%)import_iovec (50 samples, 0.40%)__import_iovec (46 samples, 0.37%)iovec_from_user.part.0 (39 samples, 0.31%)do_writev (4,064 samples, 32.38%)do_writevvfs_writev (3,990 samples, 31.79%)vfs_writevkfree (2 samples, 0.02%)syscall_enter_from_user_mode (94 samples, 0.75%)asm_sysvec_hyperv_callback (2 samples, 0.02%)sysvec_hyperv_callback (2 samples, 0.02%)__irq_exit_rcu (2 samples, 0.02%)__softirqentry_text_start (2 samples, 0.02%)syscall_exit_to_user_mode (6 samples, 0.05%)syscall_exit_to_user_mode_prepare (2 samples, 0.02%)[clash] (5,515 samples, 43.94%)[clash]writev (4,265 samples, 33.98%)writeventry_SYSCALL_64_after_hwframe (4,175 samples, 33.27%)entry_SYSCALL_64_after_hwframedo_syscall_64 (4,175 samples, 33.27%)do_syscall_64x64_sys_call (3 samples, 0.02%)[libc.so.6] (34 samples, 0.27%)[libc.so.6] (14 samples, 0.11%)[libc.so.6] (87 samples, 0.69%)asm_sysvec_hyperv_callback (2 samples, 0.02%)sysvec_hyperv_callback (2 samples, 0.02%)__irq_exit_rcu (2 samples, 0.02%)__softirqentry_text_start (2 samples, 0.02%)__libc_free (124 samples, 0.99%)asm_sysvec_hyperv_callback (2 samples, 0.02%)sysvec_hyperv_callback (2 samples, 0.02%)__irq_exit_rcu (2 samples, 0.02%)__softirqentry_text_start (2 samples, 0.02%)napi_complete_done (2 samples, 0.02%)netif_receive_skb_list_internal (2 samples, 0.02%)__netif_receive_skb_list_core (2 samples, 0.02%)ip_list_rcv (2 samples, 0.02%)ip_sublist_rcv (2 samples, 0.02%)asm_sysvec_hyperv_callback (8 samples, 0.06%)sysvec_hyperv_callback (8 samples, 0.06%)__irq_exit_rcu (8 samples, 0.06%)__softirqentry_text_start (8 samples, 0.06%)net_rx_action (3 samples, 0.02%)__napi_poll (3 samples, 0.02%)netvsc_poll (3 samples, 0.02%)clock_gettime (5 samples, 0.04%)__vdso_clock_gettime (2 samples, 0.02%)[libc.so.6] (33 samples, 0.26%)[libc.so.6] (3 samples, 0.02%)[libc.so.6] (90 samples, 0.72%)[clash] (6,275 samples, 50.00%)[clash]malloc (122 samples, 0.97%)napi_complete_done (2 samples, 0.02%)netif_receive_skb_list_internal (2 samples, 0.02%)__netif_receive_skb_list_core (2 samples, 0.02%)ip_list_rcv (2 samples, 0.02%)ip_sublist_rcv (2 samples, 0.02%)ip_sublist_rcv_finish (2 samples, 0.02%)ip_local_deliver_finish (2 samples, 0.02%)[libc.so.6] (198 samples, 1.58%)asm_sysvec_hyperv_callback (5 samples, 0.04%)sysvec_hyperv_callback (5 samples, 0.04%)__irq_exit_rcu (5 samples, 0.04%)__softirqentry_text_start (5 samples, 0.04%)net_rx_action (4 samples, 0.03%)__napi_poll (4 samples, 0.03%)netvsc_poll (4 samples, 0.03%)__errno_location (4 samples, 0.03%)[libc.so.6] (4 samples, 0.03%)__fdget_pos (2 samples, 0.02%)__fget_light (2 samples, 0.02%)eventfd_write (281 samples, 2.24%)e.._raw_spin_unlock_irq (279 samples, 2.22%)_..asm_sysvec_hyperv_callback (9 samples, 0.07%)sysvec_hyperv_callback (9 samples, 0.07%)__irq_exit_rcu (9 samples, 0.07%)__softirqentry_text_start (9 samples, 0.07%)__write (291 samples, 2.32%)_..entry_SYSCALL_64_after_hwframe (287 samples, 2.29%)e..do_syscall_64 (287 samples, 2.29%)d..ksys_write (287 samples, 2.29%)k..vfs_write (285 samples, 2.27%)v..[libc.so.6] (58 samples, 0.46%)asm_sysvec_hyperv_callback (2 samples, 0.02%)sysvec_hyperv_callback (2 samples, 0.02%)__irq_exit_rcu (2 samples, 0.02%)__softirqentry_text_start (2 samples, 0.02%)__rcu_read_lock (3 samples, 0.02%)__fdget_pos (32 samples, 0.25%)__fget_light (31 samples, 0.25%)fput (8 samples, 0.06%)__fsnotify_parent (36 samples, 0.29%)__get_task_ioprio (3 samples, 0.02%)fsnotify_perm.part.0 (11 samples, 0.09%)rw_verify_area (5 samples, 0.04%)aa_file_perm (5 samples, 0.04%)security_file_permission (30 samples, 0.24%)apparmor_file_permission (21 samples, 0.17%)__rcu_read_lock (3 samples, 0.02%)asm_sysvec_hyperv_callback (2 samples, 0.02%)sysvec_hyperv_callback (2 samples, 0.02%)__irq_exit_rcu (2 samples, 0.02%)__softirqentry_text_start (2 samples, 0.02%)__slab_free (18 samples, 0.14%)cmpxchg_double_slab.constprop.0.isra.0 (11 samples, 0.09%)__unfreeze_partials (3 samples, 0.02%)_raw_spin_unlock_irqrestore (2 samples, 0.02%)_raw_spin_lock (12 samples, 0.10%)_raw_spin_unlock (12 samples, 0.10%)__raw_callee_save___pv_queued_spin_unlock (12 samples, 0.10%)__kmem_cache_free (12 samples, 0.10%)__slab_free (31 samples, 0.25%)cmpxchg_double_slab.constprop.0.isra.0 (10 samples, 0.08%)_raw_spin_lock_irqsave (2 samples, 0.02%)__unfreeze_partials (7 samples, 0.06%)_raw_spin_unlock_irqrestore (4 samples, 0.03%)kfree (3 samples, 0.02%)put_cpu_partial (2 samples, 0.02%)skb_release_data (73 samples, 0.58%)skb_free_head (2 samples, 0.02%)consume_skb (79 samples, 0.63%)skb_release_head_state (5 samples, 0.04%)kfree_skbmem (3 samples, 0.02%)kmem_cache_free (27 samples, 0.22%)cache_from_obj (8 samples, 0.06%)__cond_resched (4 samples, 0.03%)copy_user_enhanced_fast_string (119 samples, 0.95%)_copy_to_iter (169 samples, 1.35%)copy_user_short_string (31 samples, 0.25%)asm_sysvec_hyperv_callback (3 samples, 0.02%)sysvec_hyperv_callback (3 samples, 0.02%)__irq_exit_rcu (3 samples, 0.02%)__softirqentry_text_start (3 samples, 0.02%)__check_heap_object (25 samples, 0.20%)__virt_addr_valid (15 samples, 0.12%)check_stack_object (4 samples, 0.03%)__check_object_size (82 samples, 0.65%)ksys_read (710 samples, 5.66%)ksys_re..vfs_read (658 samples, 5.24%)vfs_re..tun_chr_read_iter (544 samples, 4.33%)tun_c..tun_do_read (503 samples, 4.01%)tun_..skb_copy_datagram_iter (306 samples, 2.44%)sk..__skb_datagram_iter (303 samples, 2.41%)__..simple_copy_to_iter (86 samples, 0.69%)syscall_enter_from_user_mode (110 samples, 0.88%)asm_sysvec_hyperv_callback (3 samples, 0.02%)sysvec_hyperv_callback (3 samples, 0.02%)__irq_exit_rcu (3 samples, 0.02%)__softirqentry_text_start (3 samples, 0.02%)syscall_exit_to_user_mode (3 samples, 0.02%)syscall_exit_to_user_mode_prepare (2 samples, 0.02%)read (959 samples, 7.64%)readentry_SYSCALL_64_after_hwframe (833 samples, 6.64%)entry_SYS..do_syscall_64 (833 samples, 6.64%)do_syscal..x64_sys_call (8 samples, 0.06%)[[kernel.kallsyms]] (3 samples, 0.02%)[libc.so.6] (22 samples, 0.18%)asm_sysvec_hyperv_callback (2 samples, 0.02%)sysvec_hyperv_callback (2 samples, 0.02%)__irq_exit_rcu (2 samples, 0.02%)__softirqentry_text_start (2 samples, 0.02%)inet_sendmsg (2 samples, 0.02%)inet_send_prepare (2 samples, 0.02%)aa_sk_perm (14 samples, 0.11%)bpf_lsm_socket_sendmsg (4 samples, 0.03%)security_socket_sendmsg (33 samples, 0.26%)tomoyo_socket_sendmsg_permission (8 samples, 0.06%)__local_bh_enable_ip (3 samples, 0.02%)_raw_spin_unlock_bh (13 samples, 0.10%)__raw_callee_save___pv_queued_spin_unlock (12 samples, 0.10%)lock_sock_nested (50 samples, 0.40%)_raw_spin_lock_bh (48 samples, 0.38%)__pv_queued_spin_lock_slowpath (40 samples, 0.32%)__ip_queue_xmit (15 samples, 0.12%)ip_finish_output2 (14 samples, 0.11%)__dev_queue_xmit (12 samples, 0.10%)sch_direct_xmit (8 samples, 0.06%)dev_hard_start_xmit (8 samples, 0.06%)netvsc_xmit (7 samples, 0.06%)netvsc_send (3 samples, 0.02%)netvsc_send_pkt (2 samples, 0.02%)__tcp_transmit_skb (18 samples, 0.14%)__tcp_push_pending_frames (20 samples, 0.16%)tcp_write_xmit (20 samples, 0.16%)__slab_free (2 samples, 0.02%)cmpxchg_double_slab.constprop.0.isra.0 (2 samples, 0.02%)__kfree_skb (7 samples, 0.06%)skb_release_data (7 samples, 0.06%)free_unref_page (3 samples, 0.02%)free_pcp_prepare (2 samples, 0.02%)tcp_ack (17 samples, 0.14%)tcp_trim_head (2 samples, 0.02%)__release_sock (40 samples, 0.32%)tcp_v4_do_rcv (40 samples, 0.32%)tcp_rcv_established (40 samples, 0.32%)tcp_data_queue (2 samples, 0.02%)__kfree_skb (2 samples, 0.02%)_raw_spin_lock_bh (28 samples, 0.22%)release_sock (76 samples, 0.61%)tcp_release_cb (3 samples, 0.02%)tcp_write_xmit (2 samples, 0.02%)__virt_addr_valid (7 samples, 0.06%)__check_object_size (21 samples, 0.17%)is_vmalloc_addr (4 samples, 0.03%)__ip_finish_output (7 samples, 0.06%)skb_gso_validate_network_len (5 samples, 0.04%)skb_gso_transport_seglen (4 samples, 0.03%)__sk_dst_check (4 samples, 0.03%)ip_finish_output (2 samples, 0.02%)__local_bh_enable_ip (3 samples, 0.02%)__qdisc_run (2 samples, 0.02%)__rcu_read_unlock (2 samples, 0.02%)netdev_core_pick_tx (10 samples, 0.08%)netvsc_select_queue (7 samples, 0.06%)__skb_flow_dissect (7 samples, 0.06%)_raw_spin_lock (5 samples, 0.04%)_raw_spin_unlock (3 samples, 0.02%)__raw_callee_save___pv_queued_spin_unlock (3 samples, 0.02%)__skb_clone (3 samples, 0.02%)[[kernel.kallsyms]] (3 samples, 0.02%)consume_skb (5 samples, 0.04%)skb_release_head_state (2 samples, 0.02%)kfree_skbmem (2 samples, 0.02%)kmem_cache_free (6 samples, 0.05%)cache_from_obj (4 samples, 0.03%)packet_rcv (29 samples, 0.23%)dev_queue_xmit_nit (40 samples, 0.32%)skb_clone (7 samples, 0.06%)kmem_cache_alloc (7 samples, 0.06%)memset_erms (2 samples, 0.02%)is_vmalloc_addr (2 samples, 0.02%)_find_next_zero_bit (3 samples, 0.02%)memcpy_erms (13 samples, 0.10%)vmbus_sendpacket (15 samples, 0.12%)hv_ringbuffer_write (15 samples, 0.12%)_raw_spin_unlock_irqrestore (12 samples, 0.10%)dev_hard_start_xmit (122 samples, 0.97%)netvsc_xmit (80 samples, 0.64%)netvsc_send (67 samples, 0.53%)netvsc_send_pkt (40 samples, 0.32%)vmbus_sendpacket_pagebuffer (14 samples, 0.11%)hv_ringbuffer_write (13 samples, 0.10%)_raw_spin_unlock_irqrestore (11 samples, 0.09%)__dev_queue_xmit (163 samples, 1.30%)sch_direct_xmit (135 samples, 1.08%)validate_xmit_skb_list (3 samples, 0.02%)validate_xmit_skb (3 samples, 0.02%)skb_csum_hwoffload_help (2 samples, 0.02%)__rcu_read_unlock (2 samples, 0.02%)ip_finish_output2 (175 samples, 1.39%)neigh_resolve_output (4 samples, 0.03%)eth_header (3 samples, 0.02%)ip_local_out (2 samples, 0.02%)__ip_local_out (2 samples, 0.02%)__ip_queue_xmit (206 samples, 1.64%)ip_output (11 samples, 0.09%)nf_hook_slow (7 samples, 0.06%)apparmor_ip_postroute (2 samples, 0.02%)__skb_clone (4 samples, 0.03%)__copy_skb_header (2 samples, 0.02%)__tcp_select_window (2 samples, 0.02%)bpf_skops_write_hdr_opt.isra.0 (2 samples, 0.02%)skb_clone (3 samples, 0.02%)__tcp_transmit_skb (232 samples, 1.85%)_..tcp_update_skb_after_send (2 samples, 0.02%)ktime_get (7 samples, 0.06%)read_hv_clock_tsc (6 samples, 0.05%)_raw_spin_unlock_irqrestore (9 samples, 0.07%)__mod_timer (12 samples, 0.10%)lock_timer_base (2 samples, 0.02%)sk_reset_timer (13 samples, 0.10%)tcp_event_new_data_sent (25 samples, 0.20%)tcp_rearm_rto (8 samples, 0.06%)rb_first (4 samples, 0.03%)_raw_spin_unlock_irqrestore (5 samples, 0.04%)tcp_schedule_loss_probe (11 samples, 0.09%)sk_reset_timer (8 samples, 0.06%)__mod_timer (8 samples, 0.06%)lock_timer_base (3 samples, 0.02%)_raw_spin_lock_irqsave (2 samples, 0.02%)tcp_small_queue_check.isra.0 (3 samples, 0.02%)__tcp_push_pending_frames (294 samples, 2.34%)_..tcp_write_xmit (293 samples, 2.33%)t.._copy_from_iter (118 samples, 0.94%)copy_user_enhanced_fast_string (105 samples, 0.84%)__list_del_entry_valid (4 samples, 0.03%)__zone_watermark_ok (3 samples, 0.02%)_raw_spin_trylock (2 samples, 0.02%)__alloc_pages (150 samples, 1.20%)get_page_from_freelist (144 samples, 1.15%)clear_page_erms (126 samples, 1.00%)sk_page_frag_refill (165 samples, 1.31%)skb_page_frag_refill (163 samples, 1.30%)alloc_pages (5 samples, 0.04%)tcp_push (11 samples, 0.09%)tcp_rate_check_app_limited (5 samples, 0.04%)ipv4_mtu (4 samples, 0.03%)tcp_send_mss (25 samples, 0.20%)tcp_current_mss (22 samples, 0.18%)tcp_established_options (6 samples, 0.05%)tcp_skb_entail (6 samples, 0.05%)__build_skb_around (2 samples, 0.02%)__kmalloc_node_track_caller (11 samples, 0.09%)__kmem_cache_alloc_node (10 samples, 0.08%)kmalloc_reserve (20 samples, 0.16%)kmalloc_size_roundup (7 samples, 0.06%)kmalloc_slab (5 samples, 0.04%)__alloc_skb (34 samples, 0.27%)kmem_cache_alloc_node (11 samples, 0.09%)memset_erms (2 samples, 0.02%)page_counter_try_charge (2 samples, 0.02%)__sk_mem_schedule (6 samples, 0.05%)__sk_mem_raise_allocated (6 samples, 0.05%)mem_cgroup_charge_skmem (5 samples, 0.04%)try_charge_memcg (5 samples, 0.04%)refill_stock (2 samples, 0.02%)mem_cgroup_charge_skmem (9 samples, 0.07%)try_charge_memcg (7 samples, 0.06%)refill_stock (4 samples, 0.03%)tcp_stream_alloc_skb (51 samples, 0.41%)tcp_tx_timestamp (2 samples, 0.02%)mod_memcg_state (9 samples, 0.07%)page_counter_try_charge (6 samples, 0.05%)tcp_wmem_schedule (33 samples, 0.26%)__sk_mem_schedule (30 samples, 0.24%)__sk_mem_raise_allocated (29 samples, 0.23%)mem_cgroup_charge_skmem (22 samples, 0.18%)try_charge_memcg (12 samples, 0.10%)__sock_sendmsg (978 samples, 7.79%)__sock_send..tcp_sendmsg (939 samples, 7.48%)tcp_sendmsgtcp_sendmsg_locked (793 samples, 6.32%)tcp_send..fput (12 samples, 0.10%)import_single_range (4 samples, 0.03%)__rcu_read_lock (3 samples, 0.02%)__x64_sys_sendto (1,040 samples, 8.29%)__x64_sys_se..__sys_sendto (1,040 samples, 8.29%)__sys_sendtosockfd_lookup_light (20 samples, 0.16%)__fget_light (19 samples, 0.15%)syscall_enter_from_user_mode (57 samples, 0.45%)syscall_exit_to_user_mode (2 samples, 0.02%)[clash] (9,144 samples, 72.86%)[clash]send (1,178 samples, 9.39%)sendentry_SYSCALL_64_after_hwframe (1,107 samples, 8.82%)entry_SYSCAL..do_syscall_64 (1,107 samples, 8.82%)do_syscall_64x64_sys_call (6 samples, 0.05%)asm_sysvec_hyperv_callback (2 samples, 0.02%)sysvec_hyperv_callback (2 samples, 0.02%)__irq_exit_rcu (2 samples, 0.02%)__softirqentry_text_start (2 samples, 0.02%)[clash] (9,257 samples, 73.76%)[clash]clock_gettime (4 samples, 0.03%)__vdso_clock_gettime (2 samples, 0.02%)[libc.so.6] (70 samples, 0.56%)[libc.so.6] (7 samples, 0.06%)[libc.so.6] (59 samples, 0.47%)__libc_free (71 samples, 0.57%)__fdget_pos (5 samples, 0.04%)__fget_light (5 samples, 0.04%)_copy_from_user (2 samples, 0.02%)copy_user_short_string (2 samples, 0.02%)eventfd_write (430 samples, 3.43%)eve.._raw_spin_unlock_irq (428 samples, 3.41%)_ra..asm_sysvec_hyperv_callback (13 samples, 0.10%)sysvec_hyperv_callback (13 samples, 0.10%)__irq_exit_rcu (13 samples, 0.10%)__softirqentry_text_start (13 samples, 0.10%)ksys_write (441 samples, 3.51%)ksy..vfs_write (435 samples, 3.47%)vfs..security_file_permission (3 samples, 0.02%)apparmor_file_permission (3 samples, 0.02%)syscall_enter_from_user_mode (3 samples, 0.02%)__write (453 samples, 3.61%)__wr..entry_SYSCALL_64_after_hwframe (450 samples, 3.59%)entr..do_syscall_64 (450 samples, 3.59%)do_s..x64_sys_call (6 samples, 0.05%)asm_sysvec_hyperv_callback (8 samples, 0.06%)sysvec_hyperv_callback (8 samples, 0.06%)__irq_exit_rcu (8 samples, 0.06%)__softirqentry_text_start (8 samples, 0.06%)net_rx_action (2 samples, 0.02%)__napi_poll (2 samples, 0.02%)clock_gettime (28 samples, 0.22%)__vdso_clock_gettime (18 samples, 0.14%)[[vdso]] (11 samples, 0.09%)[libc.so.6] (19 samples, 0.15%)__fdget (2 samples, 0.02%)__fget_light (18 samples, 0.14%)asm_sysvec_hyperv_callback (2 samples, 0.02%)sysvec_hyperv_callback (2 samples, 0.02%)__irq_exit_rcu (2 samples, 0.02%)__softirqentry_text_start (2 samples, 0.02%)__list_del_entry_valid (2 samples, 0.02%)__put_user_nocheck_4 (10 samples, 0.08%)_raw_write_unlock_irq (89 samples, 0.71%)asm_sysvec_hyperv_callback (4 samples, 0.03%)sysvec_hyperv_callback (4 samples, 0.03%)__irq_exit_rcu (4 samples, 0.03%)__softirqentry_text_start (4 samples, 0.03%)eventfd_poll (15 samples, 0.12%)__rcu_read_lock (2 samples, 0.02%)_raw_spin_lock (4 samples, 0.03%)_raw_spin_unlock (7 samples, 0.06%)__raw_callee_save___pv_queued_spin_unlock (7 samples, 0.06%)ep_item_poll.isra.0 (137 samples, 1.09%)tun_chr_poll (77 samples, 0.61%)fput (4 samples, 0.03%)__cond_resched (2 samples, 0.02%)mutex_lock (32 samples, 0.25%)mutex_unlock (6 samples, 0.05%)_raw_spin_unlock_irqrestore (16 samples, 0.13%)hrtimer_init_sleeper (5 samples, 0.04%)__hrtimer_init (4 samples, 0.03%)_raw_spin_unlock_irqrestore (11 samples, 0.09%)hrtimer_try_to_cancel (15 samples, 0.12%)hrtimer_active (4 samples, 0.03%)schedule_hrtimeout_range_clock (98 samples, 0.78%)schedule (55 samples, 0.44%)__schedule (49 samples, 0.39%)finish_task_switch.isra.0 (47 samples, 0.37%)asm_sysvec_hyperv_callback (11 samples, 0.09%)sysvec_hyperv_callback (11 samples, 0.09%)__irq_exit_rcu (11 samples, 0.09%)__softirqentry_text_start (11 samples, 0.09%)net_rx_action (2 samples, 0.02%)__napi_poll (2 samples, 0.02%)netvsc_poll (2 samples, 0.02%)napi_complete_done (2 samples, 0.02%)netif_receive_skb_list_internal (2 samples, 0.02%)__netif_receive_skb_list_core (2 samples, 0.02%)ip_list_rcv (2 samples, 0.02%)ip_sublist_rcv (2 samples, 0.02%)ip_sublist_rcv_finish (2 samples, 0.02%)ip_local_deliver_finish (2 samples, 0.02%)ip_protocol_deliver_rcu (2 samples, 0.02%)tcp_v4_rcv (2 samples, 0.02%)tcp_v4_do_rcv (2 samples, 0.02%)tcp_rcv_established (2 samples, 0.02%)ktime_get_ts64 (7 samples, 0.06%)read_hv_clock_tsc (6 samples, 0.05%)do_epoll_wait (457 samples, 3.64%)do_e..select_estimate_accuracy (18 samples, 0.14%)set_normalized_timespec64 (3 samples, 0.02%)read_hv_clock_tsc (7 samples, 0.06%)__x64_sys_epoll_wait (478 samples, 3.81%)__x6..ktime_get_ts64 (13 samples, 0.10%)read_hv_clock_tsc_cs (2 samples, 0.02%)syscall_enter_from_user_mode (36 samples, 0.29%)__get_user_8 (17 samples, 0.14%)__rseq_handle_notify_resume (27 samples, 0.22%)__put_user_nocheck_8 (4 samples, 0.03%)blkcg_maybe_throttle_current (4 samples, 0.03%)exit_to_user_mode_prepare (48 samples, 0.38%)mem_cgroup_handle_over_high (8 samples, 0.06%)syscall_exit_to_user_mode (53 samples, 0.42%)syscall_exit_to_user_mode_prepare (4 samples, 0.03%)[clash] (10,816 samples, 86.18%)[clash]epoll_wait (665 samples, 5.30%)epoll_..entry_SYSCALL_64_after_hwframe (582 samples, 4.64%)entry..do_syscall_64 (582 samples, 4.64%)do_sy..x64_sys_call (7 samples, 0.06%)__vdso_clock_gettime (2 samples, 0.02%)clock_gettime (6 samples, 0.05%)_raw_spin_lock (3 samples, 0.02%)futex_wake_mark (3 samples, 0.02%)_raw_spin_unlock_irqrestore (622 samples, 4.96%)_raw_s..asm_sysvec_hyperv_callback (20 samples, 0.16%)sysvec_hyperv_callback (20 samples, 0.16%)__irq_exit_rcu (20 samples, 0.16%)__softirqentry_text_start (20 samples, 0.16%)__x64_sys_futex (645 samples, 5.14%)__x64_..do_futex (641 samples, 5.11%)do_fut..futex_wake (640 samples, 5.10%)futex_..wake_up_q (624 samples, 4.97%)wake_u..try_to_wake_up (624 samples, 4.97%)try_to..syscall_enter_from_user_mode (2 samples, 0.02%)syscall_exit_to_user_mode (2 samples, 0.02%)syscall_exit_to_user_mode_prepare (2 samples, 0.02%)[clash] (11,661 samples, 92.92%)[clash]syscall (659 samples, 5.25%)syscallentry_SYSCALL_64_after_hwframe (652 samples, 5.20%)entry_..do_syscall_64 (652 samples, 5.20%)do_sys..x64_sys_call (2 samples, 0.02%)clock_gettime (2 samples, 0.02%)__futex_queue (5 samples, 0.04%)plist_add (4 samples, 0.03%)__list_add_valid (2 samples, 0.02%)_raw_spin_unlock (4 samples, 0.03%)__raw_callee_save___pv_queued_spin_unlock (2 samples, 0.02%)futex_wait_queue (27 samples, 0.22%)schedule (15 samples, 0.12%)__schedule (14 samples, 0.11%)finish_task_switch.isra.0 (12 samples, 0.10%)futex_q_lock (12 samples, 0.10%)futex_hash (2 samples, 0.02%)__x64_sys_futex (50 samples, 0.40%)do_futex (48 samples, 0.38%)futex_wait (47 samples, 0.37%)futex_wait_setup (16 samples, 0.13%)get_futex_key (3 samples, 0.02%)syscall_enter_from_user_mode (10 samples, 0.08%)__get_user_8 (20 samples, 0.16%)__rseq_handle_notify_resume (31 samples, 0.25%)blkcg_maybe_throttle_current (2 samples, 0.02%)exit_to_user_mode_prepare (48 samples, 0.38%)mem_cgroup_handle_over_high (5 samples, 0.04%)syscall_exit_to_user_mode (51 samples, 0.41%)[clash] (11,898 samples, 94.80%)[clash]syscall (138 samples, 1.10%)entry_SYSCALL_64_after_hwframe (118 samples, 0.94%)do_syscall_64 (118 samples, 0.94%)x64_sys_call (4 samples, 0.03%)clock_gettime (18 samples, 0.14%)__vdso_clock_gettime (12 samples, 0.10%)[[vdso]] (2 samples, 0.02%)powf64 (20 samples, 0.16%)[libm.so.6] (16 samples, 0.13%)futex_wake_mark (2 samples, 0.02%)__futex_unqueue (2 samples, 0.02%)get_futex_key (2 samples, 0.02%)__x64_sys_futex (446 samples, 3.55%)__x6..do_futex (446 samples, 3.55%)do_f..futex_wake (444 samples, 3.54%)fut..wake_up_q (437 samples, 3.48%)wak..try_to_wake_up (437 samples, 3.48%)try.._raw_spin_unlock_irqrestore (437 samples, 3.48%)_ra..asm_sysvec_hyperv_callback (15 samples, 0.12%)sysvec_hyperv_callback (15 samples, 0.12%)__irq_exit_rcu (15 samples, 0.12%)__softirqentry_text_start (15 samples, 0.12%)net_rx_action (2 samples, 0.02%)__napi_poll (2 samples, 0.02%)netvsc_poll (2 samples, 0.02%)syscall_enter_from_user_mode (2 samples, 0.02%)[libc.so.6] (12,538 samples, 99.90%)[libc.so.6][libc.so.6] (12,538 samples, 99.90%)[libc.so.6][clash] (12,538 samples, 99.90%)[clash][clash] (12,538 samples, 99.90%)[clash][clash] (12,538 samples, 99.90%)[clash][clash] (12,538 samples, 99.90%)[clash][clash] (12,538 samples, 99.90%)[clash][clash] (12,475 samples, 99.40%)[clash]syscall (451 samples, 3.59%)sysc..entry_SYSCALL_64_after_hwframe (449 samples, 3.58%)entr..do_syscall_64 (449 samples, 3.58%)do_s..[clash] (3 samples, 0.02%)[clash] (3 samples, 0.02%)[clash] (2 samples, 0.02%)[clash] (4 samples, 0.03%)[clash] (4 samples, 0.03%)all (12,550 samples, 100%)tokio-runtime-w (12,545 samples, 99.96%)tokio-runtime-w[unknown] (5 samples, 0.04%)[clash] (5 samples, 0.04%)[clash] (5 samples, 0.04%) \ No newline at end of file diff --git a/clash/tests/data/config/rules.yaml b/clash/tests/data/config/rules.yaml index b99141ab2..b7b85d87f 100644 --- a/clash/tests/data/config/rules.yaml +++ b/clash/tests/data/config/rules.yaml @@ -4,7 +4,7 @@ socks-port: 8889 mixed-port: 8899 tun: - enable: false + enable: true device-id: "dev://utun1989" ipv6: true @@ -287,7 +287,7 @@ rules: - DOMAIN,google.com,select - SRC-IP-CIDR,192.168.1.1/24,DIRECT - GEOIP,CN,DIRECT - - IP-CIDR,10.0.0.11/32,select + - IP-CIDR,10.0.0.11/32,DIRECT - DST-PORT,53,ws-vmess - SRC-PORT,7777,DIRECT - MATCH, DIRECT diff --git a/clash_lib/Cargo.toml b/clash_lib/Cargo.toml index e3d362d28..e83f3261c 100644 --- a/clash_lib/Cargo.toml +++ b/clash_lib/Cargo.toml @@ -68,6 +68,8 @@ chrono = { version = "0.4.38", features = ["serde"] } tun = { git = "https://github.com/Watfaq/rust-tun.git", rev = "8f7568190f1200d3e272ca534baf8d1578147e18", features = ["async"] } netstack-lwip = { git = "https://github.com/Watfaq/netstack-lwip.git", rev = "2817bf82740e04bbee6b7bf1165f55657a6ed163" } +netdev = "0.28" + boringtun = { version = "0.6.0", git = "https://github.com/cloudflare/boringtun.git", rev = "f672bb6c1e1e371240a8d151f15854687eb740bb" } smoltcp = { version = "0.11", default-features = false, features = ["std", "log", "medium-ip", "proto-ipv4", "proto-ipv6", "socket-udp", "socket-tcp"] } diff --git a/clash_lib/src/app/dispatcher/dispatcher_impl.rs b/clash_lib/src/app/dispatcher/dispatcher_impl.rs index edb4124f2..a8c4a1b61 100644 --- a/clash_lib/src/app/dispatcher/dispatcher_impl.rs +++ b/clash_lib/src/app/dispatcher/dispatcher_impl.rs @@ -150,15 +150,50 @@ impl Dispatcher { sess, up, down ); } - Err(err) => match err.kind() { - std::io::ErrorKind::UnexpectedEof - | std::io::ErrorKind::ConnectionReset - | std::io::ErrorKind::BrokenPipe => { - debug!("connection {} closed with error {}", sess, err); + Err(err) => match err { + crate::common::io::CopyBidirectionalError::LeftClosed(err) => { + match err.kind() { + std::io::ErrorKind::UnexpectedEof + | std::io::ErrorKind::ConnectionReset + | std::io::ErrorKind::BrokenPipe => { + debug!( + "connection {} closed with error {} by local", + sess, err + ); + } + _ => { + warn!("connection {} closed with error {} by local", sess, err); + } + } } - _ => { - warn!("connection {} closed with error {}", sess, err); + crate::common::io::CopyBidirectionalError::RightClosed(err) => { + match err.kind() { + std::io::ErrorKind::UnexpectedEof + | std::io::ErrorKind::ConnectionReset + | std::io::ErrorKind::BrokenPipe => { + debug!( + "connection {} closed with error {} by remote", + sess, err + ); + } + _ => { + warn!( + "connection {} closed with error {} by remote", + sess, err + ); + } + } } + crate::common::io::CopyBidirectionalError::Other(err) => match err.kind() { + std::io::ErrorKind::UnexpectedEof + | std::io::ErrorKind::ConnectionReset + | std::io::ErrorKind::BrokenPipe => { + debug!("connection {} closed with error {}", sess, err); + } + _ => { + warn!("connection {} closed with error {}", sess, err); + } + }, }, } } diff --git a/clash_lib/src/app/outbound/manager.rs b/clash_lib/src/app/outbound/manager.rs index 86990fc21..639eb436c 100644 --- a/clash_lib/src/app/outbound/manager.rs +++ b/clash_lib/src/app/outbound/manager.rs @@ -318,7 +318,6 @@ impl OutboundManager { let relay = relay::Handler::new( relay::HandlerOptions { name: proto.name.clone(), - ..Default::default() }, providers, ); @@ -521,7 +520,6 @@ impl OutboundManager { selector::HandlerOptions { name: proto.name.clone(), udp: proto.udp.unwrap_or(true), - ..Default::default() }, providers, stored_selection, @@ -556,7 +554,6 @@ impl OutboundManager { selector::HandlerOptions { name: PROXY_GLOBAL.to_owned(), udp: true, - ..Default::default() }, vec![pd.clone()], stored_selection, diff --git a/clash_lib/src/common/io.rs b/clash_lib/src/common/io.rs index b9e5fa59b..1281c05e8 100644 --- a/clash_lib/src/common/io.rs +++ b/clash_lib/src/common/io.rs @@ -8,6 +8,45 @@ use std::time::Duration; use futures::ready; use tokio::io::{AsyncRead, AsyncWrite, ReadBuf}; +#[derive(Debug)] +pub enum CopyBidirectionalError { + LeftClosed(std::io::Error), + RightClosed(std::io::Error), + Other(std::io::Error), +} + +impl std::fmt::Display for CopyBidirectionalError { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + CopyBidirectionalError::LeftClosed(e) => { + write!(f, "left side closed with error: {}", e) + } + CopyBidirectionalError::RightClosed(e) => { + write!(f, "right side closed with error: {}", e) + } + CopyBidirectionalError::Other(e) => { + write!(f, "error: {}", e) + } + } + } +} + +impl std::error::Error for CopyBidirectionalError { + fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { + match self { + CopyBidirectionalError::LeftClosed(e) => Some(e), + CopyBidirectionalError::RightClosed(e) => Some(e), + CopyBidirectionalError::Other(e) => Some(e), + } + } +} + +impl From for CopyBidirectionalError { + fn from(e: std::io::Error) -> Self { + CopyBidirectionalError::Other(e) + } +} + #[derive(Debug)] pub struct CopyBuffer { read_done: bool, @@ -153,7 +192,7 @@ where A: AsyncRead + AsyncWrite + Unpin + ?Sized, B: AsyncRead + AsyncWrite + Unpin + ?Sized, { - type Output = io::Result<(u64, u64)>; + type Output = Result<(u64, u64), CopyBidirectionalError>; fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { // Unpack self into mut refs to each field to avoid borrow check issues. @@ -182,7 +221,9 @@ where *a_to_b = TransferState::ShuttingDown(count); continue; } - Poll::Ready(Err(err)) => return Poll::Ready(Err(err)), + Poll::Ready(Err(err)) => { + return Poll::Ready(Err(CopyBidirectionalError::LeftClosed(err))) + } Poll::Pending => { if let Some(delay) = a_to_b_delay { match delay.as_mut().poll(cx) { @@ -207,7 +248,9 @@ where .replace(Box::pin(tokio::time::sleep(*b_to_a_timeout_duration))); continue; } - Poll::Ready(Err(err)) => return Poll::Ready(Err(err)), + Poll::Ready(Err(err)) => { + return Poll::Ready(Err(CopyBidirectionalError::LeftClosed(err))) + } Poll::Pending => (), } } @@ -222,7 +265,9 @@ where *b_to_a = TransferState::ShuttingDown(count); continue; } - Poll::Ready(Err(err)) => return Poll::Ready(Err(err)), + Poll::Ready(Err(err)) => { + return Poll::Ready(Err(CopyBidirectionalError::RightClosed(err))) + } Poll::Pending => { if let Some(delay) = b_to_a_delay { match delay.as_mut().poll(cx) { @@ -247,7 +292,9 @@ where .replace(Box::pin(tokio::time::sleep(*a_to_b_timeout_duration))); continue; } - Poll::Ready(Err(err)) => return Poll::Ready(Err(err)), + Poll::Ready(Err(err)) => { + return Poll::Ready(Err(CopyBidirectionalError::RightClosed(err))) + } Poll::Pending => (), } } @@ -270,7 +317,7 @@ pub async fn copy_buf_bidirectional_with_timeout( size: usize, a_to_b_timeout_duration: Duration, b_to_a_timeout_duration: Duration, -) -> Result<(u64, u64), std::io::Error> +) -> Result<(u64, u64), CopyBidirectionalError> where A: AsyncRead + AsyncWrite + Unpin + ?Sized, B: AsyncRead + AsyncWrite + Unpin + ?Sized, diff --git a/clash_lib/src/proxy/converters/wireguard.rs b/clash_lib/src/proxy/converters/wireguard.rs index d1e5188c8..324c7d53e 100644 --- a/clash_lib/src/proxy/converters/wireguard.rs +++ b/clash_lib/src/proxy/converters/wireguard.rs @@ -23,7 +23,6 @@ impl TryFrom<&OutboundWireguard> for AnyOutboundHandler { fn try_from(s: &OutboundWireguard) -> Result { let h = Handler::new(HandlerOpts { name: s.name.to_owned(), - common_opts: Default::default(), server: s.server.to_owned(), port: s.port, ip: s diff --git a/clash_lib/src/proxy/direct/mod.rs b/clash_lib/src/proxy/direct/mod.rs index 1a813e013..de0fdf104 100644 --- a/clash_lib/src/proxy/direct/mod.rs +++ b/clash_lib/src/proxy/direct/mod.rs @@ -49,7 +49,7 @@ impl OutboundHandler for Handler { resolver, sess.destination.host().as_str(), sess.destination.port(), - None, + sess.iface.as_ref(), #[cfg(any(target_os = "linux", target_os = "android"))] None, ) @@ -94,7 +94,7 @@ impl OutboundHandler for Handler { resolver, sess.destination.host().as_str(), sess.destination.port(), - None, + sess.iface.as_ref(), #[cfg(any(target_os = "linux", target_os = "android"))] None, ) diff --git a/clash_lib/src/proxy/fallback/mod.rs b/clash_lib/src/proxy/fallback/mod.rs index 07f10856f..fc87df675 100644 --- a/clash_lib/src/proxy/fallback/mod.rs +++ b/clash_lib/src/proxy/fallback/mod.rs @@ -16,15 +16,13 @@ use crate::{ use super::{ utils::{provider_helper::get_proxies_from_providers, RemoteConnector}, - AnyOutboundHandler, CommonOption, ConnectorType, OutboundHandler, OutboundType, + AnyOutboundHandler, ConnectorType, OutboundHandler, OutboundType, }; #[derive(Default, Clone)] pub struct HandlerOptions { pub name: String, pub udp: bool, - - pub common_option: CommonOption, } pub struct Handler { diff --git a/clash_lib/src/proxy/loadbalance/mod.rs b/clash_lib/src/proxy/loadbalance/mod.rs index d4c2de435..0e518aa26 100644 --- a/clash_lib/src/proxy/loadbalance/mod.rs +++ b/clash_lib/src/proxy/loadbalance/mod.rs @@ -20,7 +20,7 @@ use self::helpers::{strategy_consistent_hashring, strategy_rr, StrategyFn}; use super::{ utils::{provider_helper::get_proxies_from_providers, RemoteConnector}, - AnyOutboundHandler, CommonOption, ConnectorType, OutboundHandler, OutboundType, + AnyOutboundHandler, ConnectorType, OutboundHandler, OutboundType, }; #[derive(Default, Clone)] @@ -28,8 +28,6 @@ pub struct HandlerOptions { pub name: String, pub udp: bool, pub strategy: LoadBalanceStrategy, - - pub common_option: CommonOption, } struct HandlerInner { diff --git a/clash_lib/src/proxy/options.rs b/clash_lib/src/proxy/options.rs index 32042280b..ebf550544 100644 --- a/clash_lib/src/proxy/options.rs +++ b/clash_lib/src/proxy/options.rs @@ -1,5 +1,6 @@ use std::collections::HashMap; +#[allow(dead_code)] pub struct HttpOption { pub method: String, pub path: Vec, diff --git a/clash_lib/src/proxy/relay/mod.rs b/clash_lib/src/proxy/relay/mod.rs index 9aaedfbeb..a71eead94 100644 --- a/clash_lib/src/proxy/relay/mod.rs +++ b/clash_lib/src/proxy/relay/mod.rs @@ -23,13 +23,12 @@ use super::{ provider_helper::get_proxies_from_providers, DirectConnector, ProxyConnector, RemoteConnector, }, - AnyOutboundHandler, CommonOption, ConnectorType, OutboundHandler, OutboundType, + AnyOutboundHandler, ConnectorType, OutboundHandler, OutboundType, }; #[derive(Default)] pub struct HandlerOptions { pub name: String, - pub common_opts: CommonOption, } pub struct Handler { diff --git a/clash_lib/src/proxy/selector/mod.rs b/clash_lib/src/proxy/selector/mod.rs index c24b5b09c..0dca766fb 100644 --- a/clash_lib/src/proxy/selector/mod.rs +++ b/clash_lib/src/proxy/selector/mod.rs @@ -17,7 +17,7 @@ use crate::{ use super::{ utils::{provider_helper::get_proxies_from_providers, RemoteConnector}, - AnyOutboundHandler, CommonOption, ConnectorType, OutboundHandler, OutboundType, + AnyOutboundHandler, ConnectorType, OutboundHandler, OutboundType, }; #[async_trait] @@ -36,8 +36,6 @@ struct HandlerInner { pub struct HandlerOptions { pub name: String, pub udp: bool, - - pub common_option: CommonOption, } #[derive(Clone)] @@ -220,7 +218,6 @@ mod tests { super::HandlerOptions { name: "test".to_owned(), udp: false, - common_option: super::CommonOption::default(), }, vec![Arc::new(RwLock::new(mock_provider))], None, diff --git a/clash_lib/src/proxy/shadowsocks/mod.rs b/clash_lib/src/proxy/shadowsocks/mod.rs index 725c176b3..e9bb93456 100644 --- a/clash_lib/src/proxy/shadowsocks/mod.rs +++ b/clash_lib/src/proxy/shadowsocks/mod.rs @@ -70,6 +70,7 @@ impl TryFrom> for SimpleOBFSOption { } } +#[allow(dead_code)] pub struct V2RayOBFSOption { pub mode: String, pub host: String, @@ -268,7 +269,7 @@ impl OutboundHandler for Handler { resolver.clone(), self.opts.server.as_str(), self.opts.port, - self.opts.common_opts.iface.as_ref(), + self.opts.common_opts.iface.as_ref().or(sess.iface.as_ref()), #[cfg(any(target_os = "linux", target_os = "android"))] None, ) @@ -307,7 +308,7 @@ impl OutboundHandler for Handler { ); let socket = new_udp_socket( None, - self.opts.common_opts.iface.as_ref(), + self.opts.common_opts.iface.as_ref().or(sess.iface.as_ref()), #[cfg(any(target_os = "linux", target_os = "android"))] None, ) @@ -339,7 +340,7 @@ impl OutboundHandler for Handler { resolver.clone(), self.opts.server.as_str(), self.opts.port, - self.opts.common_opts.iface.as_ref(), + self.opts.common_opts.iface.as_ref().or(sess.iface.as_ref()), #[cfg(any(target_os = "linux", target_os = "android"))] None, ) diff --git a/clash_lib/src/proxy/shadowsocks/shadow_tls/connector.rs b/clash_lib/src/proxy/shadowsocks/shadow_tls/connector.rs index af0413d17..aa4ffeca4 100644 --- a/clash_lib/src/proxy/shadowsocks/shadow_tls/connector.rs +++ b/clash_lib/src/proxy/shadowsocks/shadow_tls/connector.rs @@ -7,7 +7,6 @@ use rand::Rng; use rand::distributions::Distribution; use tokio::io::{AsyncReadExt, AsyncWrite, AsyncWriteExt}; use tokio_rustls::client::TlsStream; -use tokio_rustls::rustls::ClientConfig; use tokio_rustls::TlsConnector; use crate::proxy::shadowsocks::ShadowTlsOption; @@ -26,12 +25,7 @@ pub struct Opts { pub strict: bool, } -pub struct Connector { - pub password: String, - pub server_addr: String, - pub tls_config: ClientConfig, - pub connector: TlsConnector, -} +pub struct Connector; impl Connector { fn connector() -> TlsConnector { diff --git a/clash_lib/src/proxy/trojan/mod.rs b/clash_lib/src/proxy/trojan/mod.rs index e8bf985c1..468a4aae5 100644 --- a/clash_lib/src/proxy/trojan/mod.rs +++ b/clash_lib/src/proxy/trojan/mod.rs @@ -153,7 +153,7 @@ impl OutboundHandler for Handler { resolver.clone(), self.opts.server.as_str(), self.opts.port, - self.opts.common_opts.iface.as_ref(), + self.opts.common_opts.iface.as_ref().or(sess.iface.as_ref()), #[cfg(any(target_os = "linux", target_os = "android"))] None, ) @@ -184,7 +184,7 @@ impl OutboundHandler for Handler { resolver.clone(), self.opts.server.as_str(), self.opts.port, - self.opts.common_opts.iface.as_ref(), + self.opts.common_opts.iface.as_ref().or(sess.iface.as_ref()), #[cfg(any(target_os = "linux", target_os = "android"))] None, ) @@ -223,7 +223,7 @@ impl OutboundHandler for Handler { resolver, self.opts.server.as_str(), self.opts.port, - self.opts.common_opts.iface.as_ref(), + self.opts.common_opts.iface.as_ref().or(sess.iface.as_ref()), #[cfg(any(target_os = "linux", target_os = "android"))] None, ) @@ -246,7 +246,7 @@ impl OutboundHandler for Handler { resolver, self.opts.server.as_str(), self.opts.port, - self.opts.common_opts.iface.as_ref(), + self.opts.common_opts.iface.as_ref().or(sess.iface.as_ref()), #[cfg(any(target_os = "linux", target_os = "android"))] None, ) diff --git a/clash_lib/src/proxy/tuic/mod.rs b/clash_lib/src/proxy/tuic/mod.rs index 51caa78f3..50e1ebd3e 100644 --- a/clash_lib/src/proxy/tuic/mod.rs +++ b/clash_lib/src/proxy/tuic/mod.rs @@ -55,14 +55,12 @@ pub struct HandlerOptions { pub port: u16, pub uuid: Uuid, pub password: String, - pub udp_relay_mode: String, pub disable_sni: bool, pub alpn: Vec>, pub heartbeat_interval: Duration, pub reduce_rtt: bool, pub request_timeout: Duration, - pub congestion_controller: CongestionControl, - pub max_udp_relay_packet_size: u64, + pub max_open_stream: VarInt, pub gc_interval: Duration, pub gc_lifetime: Duration, @@ -70,8 +68,17 @@ pub struct HandlerOptions { pub receive_window: VarInt, /// not used + #[allow(dead_code)] + pub udp_relay_mode: String, + #[allow(dead_code)] + pub congestion_controller: CongestionControl, + #[allow(dead_code)] + pub max_udp_relay_packet_size: u64, + #[allow(dead_code)] pub ip: Option, + #[allow(dead_code)] pub skip_cert_verify: bool, + #[allow(dead_code)] pub sni: Option, } diff --git a/clash_lib/src/proxy/tun/inbound.rs b/clash_lib/src/proxy/tun/inbound.rs index 7e1a33393..4d2326344 100644 --- a/clash_lib/src/proxy/tun/inbound.rs +++ b/clash_lib/src/proxy/tun/inbound.rs @@ -2,7 +2,7 @@ use super::{datagram::TunDatagram, netstack}; use std::{net::SocketAddr, sync::Arc}; use futures::{SinkExt, StreamExt}; -use tracing::{error, info, trace, warn}; +use tracing::{debug, error, info, trace, warn}; use tun::{Device, TunPacket}; use url::Url; @@ -10,7 +10,7 @@ use crate::{ app::{dispatcher::Dispatcher, dns::ThreadSafeDNSResolver}, common::errors::map_io_error, config::internal::config::TunConfig, - proxy::datagram::UdpPacket, + proxy::{datagram::UdpPacket, utils::Interface}, session::{Network, Session, SocksAddr, Type}, Error, Runner, }; @@ -26,6 +26,15 @@ async fn handle_inbound_stream( typ: Type::Tun, source: local_addr, destination: remote_addr.into(), + iface: netdev::get_default_interface() + .map(|x| Interface::Name(x.name)) + .inspect(|x| { + debug!( + "selecting outbound interface: {:?} for tun TCP connection", + x + ); + }) + .ok(), ..Default::default() }; @@ -56,6 +65,12 @@ async fn handle_inbound_datagram( let sess = Session { network: Network::Udp, typ: Type::Tun, + iface: netdev::get_default_interface() + .map(|x| Interface::Name(x.name)) + .inspect(|x| { + debug!("selecting outbound interface: {:?} for tun UDP traffic", x); + }) + .ok(), ..Default::default() }; diff --git a/clash_lib/src/proxy/urltest/mod.rs b/clash_lib/src/proxy/urltest/mod.rs index 16424ab95..d39afbbdd 100644 --- a/clash_lib/src/proxy/urltest/mod.rs +++ b/clash_lib/src/proxy/urltest/mod.rs @@ -18,15 +18,13 @@ use crate::{ use super::{ utils::{provider_helper::get_proxies_from_providers, RemoteConnector}, - AnyOutboundHandler, CommonOption, ConnectorType, OutboundHandler, OutboundType, + AnyOutboundHandler, ConnectorType, OutboundHandler, OutboundType, }; #[derive(Default)] pub struct HandlerOptions { pub name: String, pub udp: bool, - - pub common_option: CommonOption, } struct HandlerInner { diff --git a/clash_lib/src/proxy/vmess/mod.rs b/clash_lib/src/proxy/vmess/mod.rs index 6d5c5eacd..c0769e119 100644 --- a/clash_lib/src/proxy/vmess/mod.rs +++ b/clash_lib/src/proxy/vmess/mod.rs @@ -169,7 +169,7 @@ impl OutboundHandler for Handler { resolver, self.opts.server.as_str(), self.opts.port, - self.opts.common_opts.iface.as_ref(), + self.opts.common_opts.iface.as_ref().or(sess.iface.as_ref()), #[cfg(any(target_os = "linux", target_os = "android"))] None, ) @@ -199,7 +199,7 @@ impl OutboundHandler for Handler { resolver.clone(), self.opts.server.as_str(), self.opts.port, - self.opts.common_opts.iface.as_ref(), + self.opts.common_opts.iface.as_ref().or(sess.iface.as_ref()), #[cfg(any(target_os = "linux", target_os = "android"))] None, ) @@ -252,7 +252,7 @@ impl OutboundHandler for Handler { resolver, self.opts.server.as_str(), self.opts.port, - self.opts.common_opts.iface.as_ref(), + self.opts.common_opts.iface.as_ref().or(sess.iface.as_ref()), #[cfg(any(target_os = "linux", target_os = "android"))] None, ) @@ -275,7 +275,7 @@ impl OutboundHandler for Handler { resolver, self.opts.server.as_str(), self.opts.port, - self.opts.common_opts.iface.as_ref(), + self.opts.common_opts.iface.as_ref().or(sess.iface.as_ref()), #[cfg(any(target_os = "linux", target_os = "android"))] None, ) diff --git a/clash_lib/src/proxy/vmess/vmess_impl/client.rs b/clash_lib/src/proxy/vmess/vmess_impl/client.rs index 96bfe498b..2027cc7b6 100644 --- a/clash_lib/src/proxy/vmess/vmess_impl/client.rs +++ b/clash_lib/src/proxy/vmess/vmess_impl/client.rs @@ -19,7 +19,6 @@ pub struct VmessOption { pub struct Builder { pub user: Vec, - pub uuid: uuid::Uuid, pub security: Security, pub is_aead: bool, pub is_udp: bool, @@ -53,7 +52,6 @@ impl Builder { Ok(Self { user: new_alter_id_list(&user::new_id(&uuid), opt.alter_id), - uuid, security, is_aead: opt.alter_id == 0, is_udp: opt.udp, diff --git a/clash_lib/src/proxy/wg/mod.rs b/clash_lib/src/proxy/wg/mod.rs index c0d9f3199..1eb63eefa 100644 --- a/clash_lib/src/proxy/wg/mod.rs +++ b/clash_lib/src/proxy/wg/mod.rs @@ -21,7 +21,7 @@ use crate::{ use self::{keys::KeyBytes, wireguard::Config}; -use super::{AnyOutboundHandler, CommonOption, ConnectorType, OutboundHandler, OutboundType}; +use super::{AnyOutboundHandler, ConnectorType, OutboundHandler, OutboundType}; use async_trait::async_trait; use futures::TryFutureExt; @@ -40,7 +40,6 @@ mod wireguard; pub struct HandlerOpts { pub name: String, - pub common_opts: CommonOption, pub server: String, pub port: u16, pub ip: Ipv4Addr, @@ -325,7 +324,6 @@ mod tests { async fn test_wg() -> anyhow::Result<()> { let opts = HandlerOpts { name: "wg".to_owned(), - common_opts: CommonOption::default(), server: "127.0.0.1".to_owned(), port: 10002, ip: Ipv4Addr::new(10, 13, 13, 2),