mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-09-02 09:09:17 +00:00
Fix credential ospf logic, fix udp subnet proxy loop protection (#2315)
This commit is contained in:
@@ -52,6 +52,17 @@ where
|
||||
identify: T,
|
||||
config: NetworkConfig,
|
||||
save: bool,
|
||||
) -> Result<(), RemoteClientError<E>> {
|
||||
self.handle_run_network_instance_with_source(identify, config, save, ConfigSource::User)
|
||||
.await
|
||||
}
|
||||
|
||||
async fn handle_run_network_instance_with_source(
|
||||
&self,
|
||||
identify: T,
|
||||
config: NetworkConfig,
|
||||
save: bool,
|
||||
source: ConfigSource,
|
||||
) -> Result<(), RemoteClientError<E>> {
|
||||
let client = self
|
||||
.get_rpc_client(identify.clone())
|
||||
@@ -63,7 +74,7 @@ where
|
||||
inst_id: None,
|
||||
config: Some(config.clone()),
|
||||
overwrite: true,
|
||||
source: ConfigSource::User.to_rpc(),
|
||||
source: source.to_rpc(),
|
||||
},
|
||||
)
|
||||
.await?;
|
||||
@@ -74,7 +85,7 @@ where
|
||||
identify,
|
||||
resp.inst_id.unwrap_or_default().into(),
|
||||
config,
|
||||
ConfigSource::User,
|
||||
source,
|
||||
)
|
||||
.await
|
||||
.map_err(RemoteClientError::PersistentError)?;
|
||||
@@ -273,14 +284,20 @@ where
|
||||
identify: T,
|
||||
inst_id: uuid::Uuid,
|
||||
config: NetworkConfig,
|
||||
) -> Result<(), RemoteClientError<E>> {
|
||||
self.handle_save_network_config_with_source(identify, inst_id, config, ConfigSource::User)
|
||||
.await
|
||||
}
|
||||
|
||||
async fn handle_save_network_config_with_source(
|
||||
&self,
|
||||
identify: T,
|
||||
inst_id: uuid::Uuid,
|
||||
config: NetworkConfig,
|
||||
source: ConfigSource,
|
||||
) -> Result<(), RemoteClientError<E>> {
|
||||
self.get_storage()
|
||||
.insert_or_update_user_network_config(
|
||||
identify.clone(),
|
||||
inst_id,
|
||||
config,
|
||||
ConfigSource::User,
|
||||
)
|
||||
.insert_or_update_user_network_config(identify.clone(), inst_id, config, source)
|
||||
.await
|
||||
.map_err(RemoteClientError::PersistentError)?;
|
||||
self.get_storage()
|
||||
|
||||
Reference in New Issue
Block a user