diff --git a/rust/agama-dbus-server/src/network/model.rs b/rust/agama-dbus-server/src/network/model.rs index 513efcffac..961d8b9d50 100644 --- a/rust/agama-dbus-server/src/network/model.rs +++ b/rust/agama-dbus-server/src/network/model.rs @@ -350,7 +350,7 @@ pub enum MacAddress { Random, Stable, #[default] - None, + Unset, } impl FromStr for MacAddress { @@ -362,7 +362,7 @@ impl FromStr for MacAddress { "permanent" => Ok(Self::Permanent), "random" => Ok(Self::Random), "stable" => Ok(Self::Stable), - "" => Ok(Self::None), + "" => Ok(Self::Unset), _ => Ok(Self::MacAddress(match macaddr::MacAddr6::from_str(s) { Ok(mac) => mac, Err(e) => return Err(InvalidMacAddress(e.to_string())), @@ -379,7 +379,7 @@ impl fmt::Display for MacAddress { Self::Permanent => "permanent".to_string(), Self::Random => "random".to_string(), Self::Stable => "stable".to_string(), - Self::None => "".to_string(), + Self::Unset => "".to_string(), }; write!(f, "{}", output) } diff --git a/rust/agama-dbus-server/src/network/nm/dbus.rs b/rust/agama-dbus-server/src/network/nm/dbus.rs index 0ae90bed0f..469e6bf99c 100644 --- a/rust/agama-dbus-server/src/network/nm/dbus.rs +++ b/rust/agama-dbus-server/src/network/nm/dbus.rs @@ -306,11 +306,11 @@ fn base_connection_from_dbus(conn: &OwnedNestedHash) -> Option { Ok(mac) => mac, Err(e) => { log::warn!("Couldn't parse MAC: {}", e); - MacAddress::None + MacAddress::Unset } }; } else { - base_connection.mac_address = MacAddress::None; + base_connection.mac_address = MacAddress::Unset; } } else if let Some(wireless_config) = conn.get(WIRELESS_KEY) { if let Some(mac_address) = wireless_config.get("assigned-mac-address") { @@ -319,11 +319,11 @@ fn base_connection_from_dbus(conn: &OwnedNestedHash) -> Option { Ok(mac) => mac, Err(e) => { log::warn!("Couldn't parse MAC: {}", e); - MacAddress::None + MacAddress::Unset } }; } else { - base_connection.mac_address = MacAddress::None; + base_connection.mac_address = MacAddress::Unset; } }