mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 18:18:55 +00:00
chore(connlib): remove unused event (#4110)
Seems to be a left-over from a previous design.
This commit is contained in:
@@ -123,9 +123,7 @@ where
|
||||
.send(PHOENIX_TOPIC, EgressMessages::ReuseConnection(connection));
|
||||
}
|
||||
}
|
||||
firezone_tunnel::Event::SendPacket { .. }
|
||||
| firezone_tunnel::Event::StopPeer { .. }
|
||||
| firezone_tunnel::Event::DeviceConfigUpdated => {
|
||||
firezone_tunnel::Event::SendPacket { .. } | firezone_tunnel::Event::StopPeer { .. } => {
|
||||
unreachable!("Handled internally")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,10 +167,21 @@ where
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub(crate) fn update_interface(&mut self) -> connlib_shared::Result<()> {
|
||||
let dns_mapping = self.role_state.dns_mapping();
|
||||
let config =
|
||||
self.role_state.interface_config.as_ref().expect("Developer error: we should always call update_interface after the interface config is set");
|
||||
/// Sets the interface configuration and starts background tasks.
|
||||
#[tracing::instrument(level = "trace", skip(self))]
|
||||
pub fn set_interface(&mut self, config: &InterfaceConfig) -> connlib_shared::Result<()> {
|
||||
self.role_state.interface_config = Some(config.clone());
|
||||
let effective_dns_servers = effective_dns_servers(
|
||||
config.upstream_dns.clone(),
|
||||
self.callbacks()
|
||||
.get_system_default_resolvers()
|
||||
.ok()
|
||||
.flatten()
|
||||
.unwrap_or_default(),
|
||||
);
|
||||
|
||||
let dns_mapping = sentinel_dns_mapping(&effective_dns_servers);
|
||||
self.role_state.set_dns_mapping(dns_mapping.clone());
|
||||
|
||||
self.device.initialize(
|
||||
config,
|
||||
@@ -190,24 +201,6 @@ where
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Sets the interface configuration and starts background tasks.
|
||||
#[tracing::instrument(level = "trace", skip(self))]
|
||||
pub fn set_interface(&mut self, config: &InterfaceConfig) -> connlib_shared::Result<()> {
|
||||
self.role_state.interface_config = Some(config.clone());
|
||||
let effective_dns_servers = effective_dns_servers(
|
||||
config.upstream_dns.clone(),
|
||||
self.callbacks()
|
||||
.get_system_default_resolvers()
|
||||
.ok()
|
||||
.flatten()
|
||||
.unwrap_or_default(),
|
||||
);
|
||||
|
||||
let dns_mapping = sentinel_dns_mapping(&effective_dns_servers);
|
||||
self.role_state.set_dns_mapping(dns_mapping);
|
||||
self.update_interface()
|
||||
}
|
||||
|
||||
/// Clean up a connection to a resource.
|
||||
// FIXME: this cleanup connection is wrong!
|
||||
pub fn cleanup_connection(&mut self, id: ResourceId) {
|
||||
|
||||
@@ -77,10 +77,6 @@ where
|
||||
self.device.write(packet)?;
|
||||
cx.waker().wake_by_ref();
|
||||
}
|
||||
Poll::Ready(Event::DeviceConfigUpdated) => {
|
||||
self.update_interface()?;
|
||||
cx.waker().wake_by_ref()
|
||||
}
|
||||
Poll::Ready(other) => return Poll::Ready(Ok(other)),
|
||||
_ => (),
|
||||
}
|
||||
@@ -423,5 +419,4 @@ pub enum Event<TId> {
|
||||
},
|
||||
SendPacket(IpPacket<'static>),
|
||||
StopPeer(TId),
|
||||
DeviceConfigUpdated,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user