mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
refactor(builtin): use deterministic bridge name from switch UUID
Replace psutil.net_if_addrs() scan with a deterministic name derived from the switch's node UUID: gns3 + first 6 hex chars (10 chars, fits kernel IFNAMSIZ limit of 15). Taps: <bridge>-<port> (12-13 chars). Crash recovery: brctl delete the bridge first (best-effort), then create fresh. Stale bridges from abnormal gns3server shutdown are automatically reclaimed on the next start — no EEXIST or leaked interfaces. Remove _free_iface helper and psutil import (no longer needed).
This commit is contained in:
2 files changed
+13
-13
No files matched your search
@@ -84,6 +84,7 @@ class TestEthernetSwitchNodesRoutes:
|
||||
node = compute_project.get_node(response.json()["node_id"])
|
||||
br = node._bridge_name
|
||||
node._ubridge_send.assert_has_calls([
|
||||
call(f'brctl delete "{br}"'),
|
||||
call(f'brctl create "{br}"'),
|
||||
call(f'link set "{br}" up'),
|
||||
call(f'brctl vlanfiltering "{br}" on'),
|
||||
|
||||
Reference in new issue
Block a user