From 0afbb897a5213a4f6ba9d19d5f053afe3c687a9a Mon Sep 17 00:00:00 2001 From: YueGuobin Date: Sun, 2 Aug 2026 23:23:53 +0800 Subject: [PATCH] marker: make per-filter toggle a no-op when the marker isn't installed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit _ubridge_set_marker_filter_state raised "Marker X is not installed on this node" when the capture node wasn't running — the name->bridge map is only populated during _ubridge_apply_markers, which runs when the node is up. The error was noise: the controller's enabled-only short-circuit catches it and falls back, and the controller-layer enabled is authoritative (honoured when the node starts and applies the marker). Treat a missing entry as a no-op instead of raising. --- gns3server/compute/base_node.py | 6 +++++- gns3server/compute/iou/iou_vm.py | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gns3server/compute/base_node.py b/gns3server/compute/base_node.py index e1f9fa591..54092bcda 100644 --- a/gns3server/compute/base_node.py +++ b/gns3server/compute/base_node.py @@ -1197,7 +1197,11 @@ class BaseNode: bridge_name = self._marker_filter_bridges.get(name) if not bridge_name: - raise UbridgeError(f"Marker '{name}' is not installed on this node") + # Marker not installed on this uBridge (node not started, or not yet + # applied). The controller-layer `enabled` is still authoritative and + # is honoured when the node starts and applies the marker, so a + # toggle here is a no-op rather than an error. + return state = "on" if enabled else "off" await self._ubridge_send(f"bridge enable_packet_filter {bridge_name} {name} {state}") diff --git a/gns3server/compute/iou/iou_vm.py b/gns3server/compute/iou/iou_vm.py index 33a4e6c4c..ef9cd28d8 100644 --- a/gns3server/compute/iou/iou_vm.py +++ b/gns3server/compute/iou/iou_vm.py @@ -1337,7 +1337,9 @@ class IOUVM(BaseNode): location = self._marker_filter_bridges.get(name) if not location: - raise UbridgeError(f"Marker '{name}' is not installed on this node") + # Marker not installed on this uBridge (node not started, or not yet + # applied); controller-layer `enabled` is authoritative. No-op. + return state = "on" if enabled else "off" await self._ubridge_send(f"iol_bridge enable_packet_filter {location} {name} {state}")