Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
12 changes: 8 additions & 4 deletions src/link/bond.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
};

Expand Down Expand Up @@ -125,7 +126,7 @@ impl LinkMessageBuilder<LinkBond> {
/// 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))
}

Expand All @@ -147,14 +148,17 @@ impl LinkMessageBuilder<LinkBond> {
/// 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))
}

Expand Down