fix: derive per-node IOL app id so linked routers get distinct MACs

IOL derives interface MACs from its application ID. With a constant
local-app every node shared the same MACs, and linked routers dropped
each other's frames as MAC loops — ARP never resolved and pings were
100% lost even though the whole uBridge datapath was forwarding.

Derive local-app from the node UUID (stable across restarts, kept in
1..1022) and align remote-app with the netiomux convention CML uses
(1023). Verified end to end: two iol-xe nodes, Ethernet0/0 link,
ARP resolves both ways, ping 4/5 (first loss = ARP), graceful
stop/start keeps the NVRAM config.
This commit is contained in:
YueGuobin committed 2026-09-05 21:54:51 +08:00
1 parent 0ca9ccc637
commit b17d021bf6
3 files changed
+26 -8

No files matched your search

+13 -2
View File
@@ -261,14 +261,25 @@ async def test_start_writes_iol_config(compute_project, manager):
assert config["binary"] == "/binary.iol"
assert config["num-eth"] == 16 # 4 adapters, each a 4-port unit
assert config["num-serial"] == 0
assert config["local-app"] == 1
assert config["remote-app"] == 2
assert config["local-app"] == int(vm.id.replace("-", ""), 16) % 1022 + 1
assert config["remote-app"] == 1023
assert config["memory"] == 2048
assert config["user-id"] == os.getuid()
assert config["group-id"] == os.getgid()
assert vm.status == "started"
def test_local_app_is_distinct_per_node(compute_project, manager):
# IOL derives interface MACs from the app ID: two nodes sharing one would
# drop each other's frames as MAC loops, so IDs must differ per node.
vm1 = _make_vm(compute_project, manager)
vm2 = _make_vm(compute_project, manager)
id1 = int(vm1.id.replace("-", ""), 16) % 1022 + 1
id2 = int(vm2.id.replace("-", ""), 16) % 1022 + 1
assert id1 != id2
assert 1 <= id1 <= 1022 and 1 <= id2 <= 1022
@pytest.mark.asyncio
async def test_start_rewrites_config_on_adapter_change(compute_project, manager):