Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
bond: Add back removed function and marked as deprecated
The commit 9b67c97 was removed these
functions:
 * `BondAddRequest::active_slave()`
 * `BondAddRequest::all_slaves_active()`

Let's just add it back and mark as deprecated, so we do not need to
increase major version number so frequent.

Signed-off-by: Gris Ge <fge@redhat.com>
  • Loading branch information
cathay4t committed Jul 18, 2023
1 parent 78a58db commit bf6dbf0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/link/add.rs
Expand Up @@ -49,6 +49,12 @@ impl BondAddRequest {
self
}

#[deprecated(note = "Please use `active_port` instead")]
pub fn active_slave(mut self, active_port: u32) -> Self {
self.info_data.push(InfoBond::ActivePort(active_port));
self
}

/// Adds the `active_port` attribute to the bond, where `active_port`
/// is the ifindex of an interface attached to the bond.
/// This is equivalent to `ip link add name NAME type bond active_slave
Expand Down Expand Up @@ -164,6 +170,13 @@ impl BondAddRequest {
self
}

#[deprecated(note = "Please use `all_ports_active` instead")]
pub fn all_slaves_active(mut self, all_ports_active: u8) -> Self {
self.info_data
.push(InfoBond::AllPortsActive(all_ports_active));
self
}

/// Adds the `all_ports_active` attribute to the bond
/// This is equivalent to `ip link add name NAME type bond all_slaves_active
/// ALL_PORTS_ACTIVE`.
Expand Down

0 comments on commit bf6dbf0

Please sign in to comment.