From 9b209204008a48b0372e4f45669395bab83d0225 Mon Sep 17 00:00:00 2001 From: soruh Date: Sat, 18 Feb 2023 21:12:18 +0100 Subject: [PATCH] remove port states for old ports --- src/ports.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ports.rs b/src/ports.rs index 201d2dd..c4d5857 100644 --- a/src/ports.rs +++ b/src/ports.rs @@ -236,6 +236,9 @@ impl PortHandler { self.allocated_ports .retain(|_, port| self.allowed_ports.is_allowed(*port)); // remove allocated ports that are no longer allowed + self.port_state + .retain(|port, _| self.allowed_ports.is_allowed(*port)); // remove port states that are no longer allowed + self.free_ports.retain(|port| { let is_allocted = self .allocated_ports