From 5c52e7cc5ccb1dbbc51cfb0e3fe83a4b0b8111d2 Mon Sep 17 00:00:00 2001 From: Andrej Mihajlov Date: Thu, 15 May 2025 19:19:06 +0200 Subject: [PATCH 1/2] Update to netlink 0.23 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index c49675e..1152c4f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ log = "0.4.8" thiserror = "1" netlink-sys = { version = "0.8" } netlink-packet-utils = { version = "0.5" } -netlink-packet-route = { version = "0.22" } +netlink-packet-route = { version = "0.23" } netlink-packet-core = { version = "0.7" } netlink-proto = { default-features = false, version = "0.11" } nix = { version = "0.29.0", default-features = false, features = ["fs", "mount", "sched", "signal"] } From ea67fb08c87106da2b27d1485bac4aa0d9471d31 Mon Sep 17 00:00:00 2001 From: Andrej Mihajlov Date: Thu, 15 May 2025 19:28:13 +0200 Subject: [PATCH 2/2] Adapt codebase to netlink-packet-route v0.23 --- src/link/bond.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/link/bond.rs b/src/link/bond.rs index 1c08d80..4973810 100644 --- a/src/link/bond.rs +++ b/src/link/bond.rs @@ -5,7 +5,8 @@ use std::net::{Ipv4Addr, Ipv6Addr}; use crate::{ link::LinkMessageBuilder, packet_route::link::{ - BondArpValidate, BondMode, InfoBond, InfoData, InfoKind, + BondArpAllTargets, BondArpValidate, BondFailOverMac, BondMode, + BondXmitHashPolicy, InfoBond, InfoData, InfoKind, }, }; @@ -125,7 +126,7 @@ impl LinkMessageBuilder { /// Adds the `arp_all_targets` attribute to the bond /// This is equivalent to `ip link add name NAME type bond arp_all_targets /// ARP_ALL_TARGETS` - pub fn arp_all_targets(self, arp_all_targets: u32) -> Self { + pub fn arp_all_targets(self, arp_all_targets: BondArpAllTargets) -> Self { self.append_info_data(InfoBond::ArpAllTargets(arp_all_targets)) } @@ -147,14 +148,17 @@ impl LinkMessageBuilder { /// Adds the `fail_over_mac` attribute to the bond /// This is equivalent to `ip link add name NAME type bond fail_over_mac /// FAIL_OVER_MAC`. - pub fn fail_over_mac(self, fail_over_mac: u8) -> Self { + pub fn fail_over_mac(self, fail_over_mac: BondFailOverMac) -> Self { self.append_info_data(InfoBond::FailOverMac(fail_over_mac)) } /// Adds the `xmit_hash_policy` attribute to the bond /// This is equivalent to `ip link add name NAME type bond xmit_hash_policy /// XMIT_HASH_POLICY`. - pub fn xmit_hash_policy(self, xmit_hash_policy: u8) -> Self { + pub fn xmit_hash_policy( + self, + xmit_hash_policy: BondXmitHashPolicy, + ) -> Self { self.append_info_data(InfoBond::XmitHashPolicy(xmit_hash_policy)) }