async fn online_task_cleanup(&self) -> Result<(), Error> {
        self.net_if
            .set_online(false)
            .await
            .context("Unable to mark network interface as offline")?;

        let driver_state = self.driver_state.lock();

        for entry in driver_state.address_table.iter() {
            if let Err(err) = self.net_if.remove_address(&entry.subnet) {
                fx_log_err!("Unable to remove address: {:?}", err);
            }
        }

        // Also clean-up on-mesh networks
        for entry in driver_state.on_mesh_nets.iter() {
            if let Err(err) = self.on_mesh_net_removed(&driver_state, &entry.0) {
                fx_log_err!("Removing on-mesh net `{:?}` failed: `{:?}`", &entry.0, err);
            }
        }

        // Also clean-up external routes
        for entry in driver_state.external_routes.iter() {
            if let Err(err) = self.external_route_removed(&driver_state, &entry.0) {
                fx_log_err!("Removing external_route `{:?}` failed: `{:?}`", &entry.0, err);
            }
        }

        Ok(())
    }
/// Cleanup method that is called after the online task has finished.
Cleanup method that is called after the online task has finished.
Cleanup method that is called after the online task has finished .
async fn online_task_cleanup(&self) -> Result<(), Error> {
        self.net_if
            .set_online(false)
            .await
            .context("Unable to mark network interface as offline")?;
        let driver_state = self.driver_state.lock();
        for entry in driver_state.address_table.iter() {
            if let Err(err) = self.net_if.remove_address(&entry.subnet) {
                fx_log_err!("Unable to remove address: {:?}", err);
            }
        }
        // Also clean-up on-mesh networks
        for entry in driver_state.on_mesh_nets.iter() {
            if let Err(err) = self.on_mesh_net_removed(&driver_state, &entry.0) {
                fx_log_err!("Removing on-mesh net `{:?}` failed: `{:?}`", &entry.0, err);
            }
        }
        // Also clean-up external routes
        for entry in driver_state.external_routes.iter() {
            if let Err(err) = self.external_route_removed(&driver_state, &entry.0) {
                fx_log_err!("Removing external_route `{:?}` failed: `{:?}`", &entry.0, err);
            }
        }
        Ok(())
    }
async fn online_task_cleanup ( & self ) -> Result < ( ) , Error > { self . net_if . set_online ( false ) . await . context ( " " ) ? ; let driver_state = self . driver_state . lock ( ) ; for entry in driver_state . address_table . iter ( ) { if let Err ( err ) = self . net_if . remove_address ( & entry . subnet ) { fx_log_err ! ( " " err ) ; } } // Also clean-up on-mesh networks for entry in driver_state . on_mesh_nets . iter ( ) { if let Err ( err ) = self . on_mesh_net_removed ( & driver_state , & entry . 0 ) { fx_log_err ! ( " " entry 0 err ) ; } } // Also clean-up external routes for entry in driver_state . external_routes . iter ( ) { if let Err ( err ) = self . external_route_removed ( & driver_state , & entry . 0 ) { fx_log_err ! ( " " entry 0 err ) ; } } Ok ( ( ) ) }
Cleanup method that is called after the online task has finished.
Cleanup method that is called after the online task has finished .
&self
&self