src/config/network.rs: parse bond-slaves

This commit is contained in:
Dietmar Maurer
2020-04-23 09:31:10 +02:00
parent 1d9a68c2fc
commit 42fbe91a34
4 changed files with 27 additions and 0 deletions

View File

@ -34,6 +34,7 @@ impl Interface {
options_v6: Vec::new(),
mtu: None,
bridge_ports: None,
bond_slaves: None,
}
}
@ -112,6 +113,15 @@ impl Interface {
}
}
}
NetworkInterfaceType::Bond => {
if let Some(ref slaves) = self.bond_slaves {
if slaves.is_empty() {
writeln!(w, " bond-slaves none")?;
} else {
writeln!(w, " bond-slaves {}", slaves.join(" "))?;
}
}
}
_ => {}
}
@ -178,6 +188,7 @@ impl Interface {
gateway_v6: _gateway_v6,
mtu: _mtu,
bridge_ports: _bridge_ports,
bond_slaves: _bond_slaves,
} => {
method_v4 == method_v6
&& options_v4.is_empty()