From 264f1f00b4fe675c0bb126c3a44cc9809483eb03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Kub=C3=ADk?= Date: Mon, 5 Feb 2024 12:00:20 +0100 Subject: [PATCH] feat: update to rust-tun version with automatic route set up on MacOS --- Cargo.lock | 40 +++++++++++++++++++++++++++------------- Cargo.toml | 2 +- README.md | 3 ++- src/interface.rs | 2 +- 4 files changed, 31 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3960116..5f66f54 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -217,6 +217,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cidr_util" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5264ac37a57476c8c433490596802c4ff683687b271c9ccfd26c142d41f0da68" + [[package]] name = "clap" version = "4.4.18" @@ -508,9 +514,9 @@ checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" [[package]] name = "indexmap" -version = "2.2.1" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "433de089bd45971eecf4668ee0ee8f4cec17db4f8bd8f7bc3197a6ce37aa7d9b" +checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" dependencies = [ "equivalent", "hashbrown", @@ -604,9 +610,9 @@ checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ "adler", ] @@ -632,6 +638,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "num_cpus" version = "1.16.0" @@ -764,7 +776,7 @@ dependencies = [ [[package]] name = "quincy" -version = "0.6.0" +version = "0.6.1" dependencies = [ "anyhow", "argon2", @@ -1294,11 +1306,12 @@ dependencies = [ [[package]] name = "time" -version = "0.3.31" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" +checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" dependencies = [ "deranged", + "num-conv", "powerfmt", "serde", "time-core", @@ -1327,9 +1340,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.35.1" +version = "1.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" +checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" dependencies = [ "backtrace", "bytes", @@ -1488,11 +1501,12 @@ dependencies = [ [[package]] name = "tun2" -version = "1.0.1" +version = "1.0.201" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0bc4dcfe2bca93d2acc036d09242ece6a778f807428980586677a8c6c556171" +checksum = "213819a3a706da84ce60d7b69d199fae530933d92377e2ccad15ff7f24eed07a" dependencies = [ "bytes", + "cidr_util", "futures-core", "ioctl-sys", "libc", @@ -1799,9 +1813,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.36" +version = "0.5.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "818ce546a11a9986bc24f93d0cdf38a8a1a400f1473ea8c82e59f6e0ffab9249" +checksum = "a7cad8365489051ae9f054164e459304af2e7e9bb407c958076c8bf4aef52da5" dependencies = [ "memchr", ] diff --git a/Cargo.toml b/Cargo.toml index bdff255..c2c3dd9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "quincy" -version = "0.6.0" +version = "0.6.1" authors = ["Jakub KubĂ­k "] license = "MIT" description = "QUIC-based VPN" diff --git a/README.md b/README.md index c6613b7..f525602 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,8 @@ With the configuration file in place, the client can be started using the follow $ quincy-client --config-path examples/client.toml ``` -Routes are set up by default on some systems (Linux) and not set-up at all on others (MacOS). +Routes are set by default to the address and netmask received from the server. +Any additional routes now have to be set up manually. ### Server The Quincy server requires a separate configuration file, an example of which can be found in `examples/server.toml`: diff --git a/src/interface.rs b/src/interface.rs index 1ac33d0..3bac75f 100644 --- a/src/interface.rs +++ b/src/interface.rs @@ -49,7 +49,7 @@ impl Interface for AsyncDevice { config .address(interface_address.addr()) .netmask(interface_address.netmask()) - .mtu(mtu as usize) + .mtu(mtu) .up(); // Needed due to rust-tun using the destination address as the default GW