From 3b9e75634aa06b6df0519e5d44fd6e5281712d09 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Sat, 25 Dec 2021 19:19:19 +0100 Subject: Allow Diplonat to automatically detect it's private IP --- src/fw_actor.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/fw_actor.rs') diff --git a/src/fw_actor.rs b/src/fw_actor.rs index 0fa6e64..ac553b1 100644 --- a/src/fw_actor.rs +++ b/src/fw_actor.rs @@ -32,7 +32,7 @@ impl FirewallActor { fw::setup(&ctx.ipt)?; - return Ok(ctx) + return Ok(ctx); } pub async fn listen(&mut self) -> Result<()> { @@ -40,7 +40,7 @@ impl FirewallActor { loop { // 1. Wait for an event let new_ports = select! { - Some(ports) = self.rx_ports.recv() => Some(ports), + _ = self.rx_ports.changed() => Some(self.rx_ports.borrow().clone()), _ = interval.tick() => None, else => return Ok(()) // Sender dropped, terminate loop. }; @@ -81,6 +81,6 @@ impl FirewallActor { fw::open_ports(&self.ipt, ports_to_open)?; - return Ok(()) + return Ok(()); } } -- cgit v1.2.3