l2: name the group a learned address sits behind

A device on an aggregate is learned against whichever member the frame came in
on, and the hash moves that around: the same address changes port every time
the flow mix changes. The table was telling the truth and there was no way to
read it, since nothing on the page or the console says those two ports are one
link.

port_lag_of() already exists and already knows the answer, so both views ask
it. The console prints LAG1 in place of the member, and /l2.json carries a
"lag" field beside the port, 0 when the port stands alone, which is the shape
/stp.json already uses.

Costs 151 bytes of BANK1.
This commit is contained in:
d00f committed 2026-09-05 17:29:13 +02:00
1 parent 8a7b146892
commit 8b7306f995
3 files changed
+22 -3

No files matched your search

+10 -2
View File
@@ -68,7 +68,11 @@ var l2SortCol = 'port';
var l2SortDir = 1;
function l2Key(e, col) {
if (col === 'port') return e.port === 'CPU' ? Number.MAX_SAFE_INTEGER : Number(e.port);
if (col === 'port') {
if (e.port === 'CPU') return Number.MAX_SAFE_INTEGER;
if (e.lag) return 100 + e.lag;
return Number(e.port);
}
if (col === 'vlan') return Number(e.vlan);
return String(e[col]).toLowerCase();
}
@@ -114,7 +118,11 @@ function fillL2(s)
return;
s.sort(l2CMP);
s = uniq(s);
l2All = s;
l2All = s.map(function(e) {
if (e.lag)
e.port = 'LAG' + e.lag;
return e;
});
renderL2();
}