Skip to content

Commit 47ea04c

Browse files
committed
route: use netlink-packet-route 0.24.0
Signed-off-by: Renato Westphal <[email protected]>
1 parent 30aa30f commit 47ea04c

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ log = "0.4.8"
2323
thiserror = "1"
2424
netlink-sys = { version = "0.8" }
2525
netlink-packet-utils = { version = "0.5" }
26-
netlink-packet-route = { version = "0.22" }
26+
netlink-packet-route = { version = "0.24" }
2727
netlink-packet-core = { version = "0.7" }
2828
netlink-proto = { default-features = false, version = "0.11" }
2929
nix = { version = "0.29.0", default-features = false, features = ["fs", "mount", "sched", "signal"] }

src/link/bond.rs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ use std::net::{Ipv4Addr, Ipv6Addr};
55
use crate::{
66
link::LinkMessageBuilder,
77
packet_route::link::{
8-
BondArpValidate, BondMode, InfoBond, InfoData, InfoKind,
8+
BondArpAllTargets, BondArpValidate, BondFailOverMac, BondMode,
9+
BondPrimaryReselect, BondXmitHashPolicy, InfoBond, InfoData, InfoKind,
910
},
1011
};
1112

@@ -125,7 +126,7 @@ impl LinkMessageBuilder<LinkBond> {
125126
/// Adds the `arp_all_targets` attribute to the bond
126127
/// This is equivalent to `ip link add name NAME type bond arp_all_targets
127128
/// ARP_ALL_TARGETS`
128-
pub fn arp_all_targets(self, arp_all_targets: u32) -> Self {
129+
pub fn arp_all_targets(self, arp_all_targets: BondArpAllTargets) -> Self {
129130
self.append_info_data(InfoBond::ArpAllTargets(arp_all_targets))
130131
}
131132

@@ -140,21 +141,27 @@ impl LinkMessageBuilder<LinkBond> {
140141
/// Adds the `primary_reselect` attribute to the bond
141142
/// This is equivalent to `ip link add name NAME type bond primary_reselect
142143
/// PRIMARY_RESELECT`.
143-
pub fn primary_reselect(self, primary_reselect: u8) -> Self {
144+
pub fn primary_reselect(
145+
self,
146+
primary_reselect: BondPrimaryReselect,
147+
) -> Self {
144148
self.append_info_data(InfoBond::PrimaryReselect(primary_reselect))
145149
}
146150

147151
/// Adds the `fail_over_mac` attribute to the bond
148152
/// This is equivalent to `ip link add name NAME type bond fail_over_mac
149153
/// FAIL_OVER_MAC`.
150-
pub fn fail_over_mac(self, fail_over_mac: u8) -> Self {
154+
pub fn fail_over_mac(self, fail_over_mac: BondFailOverMac) -> Self {
151155
self.append_info_data(InfoBond::FailOverMac(fail_over_mac))
152156
}
153157

154158
/// Adds the `xmit_hash_policy` attribute to the bond
155159
/// This is equivalent to `ip link add name NAME type bond xmit_hash_policy
156160
/// XMIT_HASH_POLICY`.
157-
pub fn xmit_hash_policy(self, xmit_hash_policy: u8) -> Self {
161+
pub fn xmit_hash_policy(
162+
self,
163+
xmit_hash_policy: BondXmitHashPolicy,
164+
) -> Self {
158165
self.append_info_data(InfoBond::XmitHashPolicy(xmit_hash_policy))
159166
}
160167

0 commit comments

Comments
 (0)