Skip to content
Merged
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
11 changes: 0 additions & 11 deletions rust/agama-server/src/network/nm/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@ impl<'a> NetworkManagerAdapter<'a> {
let client = NetworkManagerClient::new(connection.clone()).await?;
Ok(Self { client, connection })
}

/// Determines whether the write operation is supported for a connection
///
/// * `conn`: connection
fn is_writable(conn: &Connection) -> bool {
!conn.is_loopback()
}
}

#[async_trait]
Expand Down Expand Up @@ -118,10 +111,6 @@ impl<'a> Adapter for NetworkManagerAdapter<'a> {
}

for conn in ordered_connections(network) {
if !Self::is_writable(conn) {
continue;
}

if let Some(old_conn) = old_state.get_connection_by_uuid(conn.uuid) {
if old_conn == conn {
continue;
Expand Down
3 changes: 3 additions & 0 deletions rust/agama-server/src/network/nm/dbus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ pub fn connection_to_dbus<'a>(
connection_dbus.insert("type", INFINIBAND_KEY.into());
result.insert(INFINIBAND_KEY, infiniband_config_to_dbus(infiniband));
}
ConnectionConfig::Loopback => {
connection_dbus.insert("type", LOOPBACK_KEY.into());
}
_ => {}
}

Expand Down
4 changes: 2 additions & 2 deletions rust/agama-server/src/network/nm/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ impl TryFrom<NmDeviceType> for DeviceType {

fn try_from(value: NmDeviceType) -> Result<Self, Self::Error> {
match value {
NmDeviceType(0) => Ok(DeviceType::Loopback),
NmDeviceType(32) => Ok(DeviceType::Loopback),
NmDeviceType(1) => Ok(DeviceType::Ethernet),
NmDeviceType(2) => Ok(DeviceType::Wireless),
NmDeviceType(3) => Ok(DeviceType::Dummy),
NmDeviceType(22) => Ok(DeviceType::Dummy),
NmDeviceType(10) => Ok(DeviceType::Bond),
NmDeviceType(_) => Err(NmError::UnsupportedDeviceType(value.into())),
}
Expand Down
6 changes: 6 additions & 0 deletions rust/package/agama.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Jun 12 10:15:33 UTC 2024 - Jorik Cronenberg <jorik.cronenberg@suse.com>

- Allow writing to loopback connection in agama-server
(gh#openSUSE/agama#1318).

-------------------------------------------------------------------
Tue Jun 11 21:35:00 UTC 2024 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

Expand Down