From 22b0c9fcadd94696f323673ce649483fc9d8dd82 Mon Sep 17 00:00:00 2001 From: Astro Date: Sun, 20 Dec 2020 20:43:20 +0100 Subject: [PATCH] main: don't re- set_ipv4_config every tick --- src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 41b878f..238d88d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -441,7 +441,11 @@ fn main() -> ! { }); // Apply new IPv4 address/gateway - new_ipv4_config.map(|config| server.set_ipv4_config(config)); + new_ipv4_config.take() + .map(|config| { + server.set_ipv4_config(config.clone()); + ipv4_config = config; + }); // Update watchdog wd.feed();