From ba318150facdc2ed55997cce1200f5dc65c4c1b5 Mon Sep 17 00:00:00 2001 From: YueGuobin Date: Fri, 7 Aug 2026 13:30:12 +0800 Subject: [PATCH] iou: skip already-installed markers in _ubridge_apply_markers (NIO update idempotency) The IOU override of _ubridge_apply_markers lacked the incremental guard the generic path has, so on an NIO update it re-added every marker the port already carried. uBridge's add_packet_filter rejects a duplicate filter name (packet_filter.c find_packet_filter), so adding a private marker to an IOU link that already hosted an inherited global-* copy failed with 'Failed to add filter global-...' -- the NIO update re-sends ALL markers on the port (inherited + new private), and the pre-existing one collided. Add the same (name, link_id) in self._marker_filter_bridges skip as the generic base_node path, so an update only installs markers not already on the port. Mirrors how Dynamips/vpcs/etc. stay idempotent across add + update. --- gns3server/compute/iou/iou_vm.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/gns3server/compute/iou/iou_vm.py b/gns3server/compute/iou/iou_vm.py index 5803a9816..edba56876 100644 --- a/gns3server/compute/iou/iou_vm.py +++ b/gns3server/compute/iou/iou_vm.py @@ -1290,9 +1290,18 @@ class IOUVM(BaseNode): bridge_name=bridge_name, bay=adapter_number, unit=port_number ) for name, spec in markers.items(): + link_id = spec.get("link_id", "") + # Incremental: skip markers already installed on this port. A NIO + # update carries EVERY marker on the port (e.g. an inherited + # global-* copy plus a newly added private one); uBridge's + # add_packet_filter rejects a duplicate filter name (packet_filter.c), + # so we must not re-add one already here — mirrors the generic + # _ubridge_apply_markers guard. A fresh bridge has an empty map + # (cleared on _stop_ubridge) so all are installed. + if (name, link_id) in self._marker_filter_bridges: + continue bpf = spec.get("bpf", "") tag = spec.get("tag") - link_id = spec.get("link_id", "") pcap_path = os.path.join( markers_dir, f"{self._id}_{link_id}_{name}.pcap" )