upgrade dependency rtnetlink and fix regressions

This commit is contained in:
Ilka Schulz
2026-06-09 10:20:16 +02:00
parent a587f00657
commit 54ddf3d0ec
3 changed files with 27 additions and 62 deletions
Generated
+20 -58
View File
@@ -1040,9 +1040,9 @@ checksum = "4d8935531e8e0919b17043c668cc18bfac1622f2fab73125f4f018124ee330b8"
dependencies = [
"futures",
"log",
"netlink-packet-core 0.8.1",
"netlink-packet-core",
"netlink-packet-generic",
"netlink-proto 0.12.0",
"netlink-proto",
"thiserror 1.0.69",
"tokio",
]
@@ -1453,17 +1453,6 @@ dependencies = [
"syn 1.0.109",
]
[[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-core"
version = "0.8.1"
@@ -1479,33 +1468,19 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2f891b2e0054cac5a684a06628f59568f841c93da4e551239da6e518f539e775"
dependencies = [
"netlink-packet-core 0.8.1",
"netlink-packet-core",
]
[[package]]
name = "netlink-packet-route"
version = "0.19.0"
version = "0.30.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "74c171cd77b4ee8c7708da746ce392440cb7bcf618d122ec9ecc607b12938bf4"
checksum = "be8919612f6028ab4eacbbfe1234a9a43e3722c6e0915e7ff519066991905092"
dependencies = [
"anyhow",
"byteorder",
"bitflags",
"libc",
"log",
"netlink-packet-core 0.7.0",
"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 1.0.69",
"netlink-packet-core",
]
[[package]]
@@ -1517,24 +1492,10 @@ dependencies = [
"bitflags",
"libc",
"log",
"netlink-packet-core 0.8.1",
"netlink-packet-core",
"netlink-packet-generic",
]
[[package]]
name = "netlink-proto"
version = "0.11.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72452e012c2f8d612410d89eea01e2d9b56205274abb35d53f60200b2ec41d60"
dependencies = [
"bytes",
"futures",
"log",
"netlink-packet-core 0.7.0",
"netlink-sys",
"thiserror 2.0.18",
]
[[package]]
name = "netlink-proto"
version = "0.12.0"
@@ -1544,7 +1505,7 @@ dependencies = [
"bytes",
"futures",
"log",
"netlink-packet-core 0.8.1",
"netlink-packet-core",
"netlink-sys",
"thiserror 2.0.18",
]
@@ -1564,12 +1525,13 @@ dependencies = [
[[package]]
name = "nix"
version = "0.27.1"
version = "0.30.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053"
checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6"
dependencies = [
"bitflags",
"cfg-if",
"cfg_aliases",
"libc",
]
@@ -2097,7 +2059,7 @@ dependencies = [
"genetlink",
"libc",
"log",
"netlink-packet-core 0.8.1",
"netlink-packet-core",
"netlink-packet-generic",
"netlink-packet-wireguard",
"rosenpass",
@@ -2191,18 +2153,18 @@ dependencies = [
[[package]]
name = "rtnetlink"
version = "0.14.1"
version = "0.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b684475344d8df1859ddb2d395dd3dac4f8f3422a1aa0725993cb375fc5caba5"
checksum = "dc19f84f710fa2f337617f9bc0400260a94224bde7bae28fd8879f3771ca5784"
dependencies = [
"futures",
"futures-channel",
"futures-util",
"log",
"netlink-packet-core 0.7.0",
"netlink-packet-core",
"netlink-packet-route",
"netlink-packet-utils",
"netlink-proto 0.11.5",
"netlink-proto",
"netlink-sys",
"nix 0.27.1",
"nix 0.30.1",
"thiserror 1.0.69",
"tokio",
]
+1 -1
View File
@@ -38,7 +38,7 @@ futures-util = { workspace = true }
[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies]
ctrlc = "3.2"
genetlink = "0.2"
rtnetlink = "0.14"
rtnetlink = "0.21"
netlink-packet-core = "0.8.1"
netlink-packet-generic = "0.4"
netlink-packet-wireguard = "0.4"
+6 -3
View File
@@ -1,6 +1,7 @@
use std::any::type_name;
use std::{borrow::Borrow, net::SocketAddr, path::PathBuf};
use rtnetlink::{LinkUnspec, LinkWireguard};
use tokio::process::Command;
use anyhow::{Context, Result, bail, ensure};
@@ -151,8 +152,7 @@ impl WireGuardDeviceImpl {
// Add the link, equivalent to `ip link add <link_name> type wireguard`.
rtnl_link
.add()
.wireguard(device_name.to_owned())
.add(LinkWireguard::new(device_name.as_str()).build())
.execute()
.await?;
log::info!("Created network device!");
@@ -185,7 +185,10 @@ impl WireGuardDeviceImpl {
self.device = Some((device_handle, device_name));
// Activate the link, equivalent to `ip link set dev <DEV> up`.
rtnl_link.set(device_handle).up().execute().await?;
rtnl_link
.change(LinkUnspec::new_with_index(device_handle).up().build())
.execute()
.await?;
Ok(())
}