From 80bf0848760476d86f2f7f249dbb3352d8b9ad07 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Fri, 8 May 2020 10:20:57 +0200 Subject: [PATCH] src/config/network.rs: do not combine entries It is unclear when and how to write combined entries ... --- src/config/network.rs | 46 ------------------------------------------- 1 file changed, 46 deletions(-) diff --git a/src/config/network.rs b/src/config/network.rs index 7a9bbda4..e5321da4 100644 --- a/src/config/network.rs +++ b/src/config/network.rs @@ -225,41 +225,6 @@ impl Interface { Ok(()) } - /// Return whether we can write a single entry for inet and inet6 - fn combine_entry(&self) -> bool { - // Note: use match to make sure we considered all values at compile time - match self { - Interface { - method, - method6, - options, - options6, - comments, - comments6, - // the rest does not matter - name: _name, - interface_type: _interface_type, - autostart: _autostart, - active: _active, - cidr: _cidr, - cidr6: _cidr6, - gateway: _gateway, - gateway6: _gateway6, - mtu: _mtu, - bridge_ports: _bridge_ports, - bridge_vlan_aware: _bridge_vlan_aware, - slaves: _slaves, - bond_mode: _bond_mode, - } => { - method == method6 - && comments.is_none() - && comments6.is_none() - && options.is_empty() - && options6.is_empty() - } - } - } - fn write_iface(&self, w: &mut dyn Write) -> Result<(), Error> { fn method_to_str(method: NetworkConfigMethod) -> &'static str { @@ -277,17 +242,6 @@ impl Interface { writeln!(w, "auto {}", self.name)?; } - if self.combine_entry() { - if let Some(method) = self.method { - writeln!(w, "iface {} {}", self.name, method_to_str(method))?; - self.write_iface_attributes_v4(w, method)?; - self.write_iface_attributes_v6(w, method)?; - self.write_iface_attributes(w)?; - writeln!(w)?; - } - return Ok(()); - } - if let Some(method) = self.method { writeln!(w, "iface {} inet {}", self.name, method_to_str(method))?; self.write_iface_attributes_v4(w, method)?;