mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
fix: scope marker reconcile to the current bridge/NIO
The reconcile pass in _ubridge_apply_markers walked the node-wide _marker_filter_bridges map but compared against `desired`, which only carries the markers of the NIO being updated. Updating any one link therefore deleted every other link's markers (and their pcaps) on that node — a regression from the add-only→reconcile switch. IOU's override had the same flaw across its ports. Guard the delete pass with the current bridge (base_node) / IOL location (IOU) so only markers on the NIO being reconciled can be removed. Added a regression test that fails without the guard.
This commit is contained in:
3 files changed
+41
No files matched your search
@@ -1256,7 +1256,13 @@ class BaseNode:
|
||||
desired = {(name, spec.get("link_id", "")): spec for name, spec in markers.items()}
|
||||
|
||||
# 1. Remove installed markers that are no longer desired (marker/def delete).
|
||||
# Scope to THIS bridge: the map is node-wide and also holds markers
|
||||
# installed on this node's other links/NIOs. Without this guard,
|
||||
# reconciling one NIO would delete every other link's markers + pcaps
|
||||
# (desired only carries the current NIO's markers) — a regression.
|
||||
for key in list(self._marker_filter_bridges):
|
||||
if self._marker_filter_bridges[key] != bridge_name:
|
||||
continue
|
||||
if key not in desired:
|
||||
mname, link_id = key
|
||||
installed_bridge = self._marker_filter_bridges.pop(key)
|
||||
|
||||
@@ -1291,7 +1291,12 @@ class IOUVM(BaseNode):
|
||||
desired = {(name, spec.get("link_id", "")): spec for name, spec in markers.items()}
|
||||
|
||||
# 1. Remove installed markers that are no longer desired.
|
||||
# Scope to THIS port's IOL location — the map is node-wide and also
|
||||
# holds markers on this IOU's other ports, which must not be deleted
|
||||
# when reconciling a single NIO (see base_node for the same guard).
|
||||
for key in list(self._marker_filter_bridges):
|
||||
if self._marker_filter_bridges[key] != location:
|
||||
continue
|
||||
if key not in desired:
|
||||
mname, link_id = key
|
||||
installed_location = self._marker_filter_bridges.pop(key)
|
||||
|
||||
Reference in new issue
Block a user