Skip to content

Commit

Permalink
Allow writing to NM loopback connection
Browse files Browse the repository at this point in the history
  • Loading branch information
jcronenberg committed Jun 12, 2024
1 parent a4de441 commit 61780d8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
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

0 comments on commit 61780d8

Please sign in to comment.