The inspector panel and show interfaces describe a port's VLAN in different words - and one of them is wrong #1291

Closed
opened 2026-11-09 22:58:34 +00:00 by jaylouisw · 0 comments
Owner

show interfaces <port> prints one line saying what the port does with a frame, and the inspector panel shows
the same fact under a VLAN heading. The browser cannot require the engine, so the rule exists twice — and
the two copies had drifted.

Measured on the same four ports:

port state                                            panel said            console said
{access, nativeVlan 20}                               access 1              access VLAN 1 · trunk staged: native 20 (not in use)
{access, accessVlan 20}                               access 20             access VLAN 20
{trunk, allowedVlans: []}                             trunk · native 1 · allowed (nothing)
                                                      → claimed "allowed"   trunk · native 1 · allowed none
{access, allowedVlans: [10,20]}                       access 1              access VLAN 1 · trunk staged: allowed 10,20 (not in use)

Three separate lies:

  • the panel knew nothing about parameters that are stored but not in force, so a port staged for a trunk
    looked identical to a plain access port;
  • || 1 on every field made an unset trunk native VLAN indistinguishable from a native VLAN of 1;
  • an empty allowed list (a trunk that classifyEgress drops every VLAN on) was rendered
    trunk · native 1 · allowed — a claim, with the list missing.

The panel's rendering was also a second spelling of one fact: access 20 in the panel, access VLAN 20 in the
console, so an operator comparing the two had to translate.

What "done" looks like

  • one sentence, written once in engine/vlan.js as switchportSentence(), printed by the console after
    switchport: and mirrored in web/app.js for the panel — the same string in both places:
    • access VLAN 20
    • access VLAN 1 · trunk staged: native 20 (not in use)
    • trunk · native 30 · allowed 10,20
    • trunk · native 1 · allowed none
  • the staged clause is read from the stored fields, not the normalised ones — the normaliser derives a
    native VLAN from the access VLAN when the field is absent, so asking it would report a staged parameter on
    every access port in a non-default VLAN;
  • every claim the sentence makes is checked against classifyEgress: allowed all carries every probed VLAN,
    allowed none carries none, a listed VLAN is carried, an unlisted one is not, access VLAN N carries N, and
    anything called "staged" is not carried;
  • the two implementations are compared across 360 port states (mode × access VLAN × native VLAN × allowed
    list), the way fabric-agreement and port-state-agreement compare their mirrors.

test/ui-render.test.js now asserts the console's words (access VLAN 20) rather than the old panel spelling.

`show interfaces <port>` prints one line saying what the port does with a frame, and the inspector panel shows the same fact under a `VLAN` heading. The browser cannot `require` the engine, so the rule exists twice — and the two copies had drifted. Measured on the same four ports: ``` port state panel said console said {access, nativeVlan 20} access 1 access VLAN 1 · trunk staged: native 20 (not in use) {access, accessVlan 20} access 20 access VLAN 20 {trunk, allowedVlans: []} trunk · native 1 · allowed (nothing) → claimed "allowed" trunk · native 1 · allowed none {access, allowedVlans: [10,20]} access 1 access VLAN 1 · trunk staged: allowed 10,20 (not in use) ``` Three separate lies: * the panel knew nothing about parameters that are **stored but not in force**, so a port staged for a trunk looked identical to a plain access port; * `|| 1` on every field made an unset trunk native VLAN indistinguishable from a native VLAN of 1; * an **empty allowed list** (a trunk that `classifyEgress` drops every VLAN on) was rendered `trunk · native 1 · allowed ` — a claim, with the list missing. The panel's rendering was also a second spelling of one fact: `access 20` in the panel, `access VLAN 20` in the console, so an operator comparing the two had to translate. ## What "done" looks like * one sentence, written once in `engine/vlan.js` as `switchportSentence()`, printed by the console after `switchport: ` and mirrored in `web/app.js` for the panel — the same string in both places: * `access VLAN 20` * `access VLAN 1 · trunk staged: native 20 (not in use)` * `trunk · native 30 · allowed 10,20` * `trunk · native 1 · allowed none` * the staged clause is read from the **stored** fields, not the normalised ones — the normaliser derives a native VLAN from the access VLAN when the field is absent, so asking it would report a staged parameter on every access port in a non-default VLAN; * every claim the sentence makes is checked against `classifyEgress`: `allowed all` carries every probed VLAN, `allowed none` carries none, a listed VLAN is carried, an unlisted one is not, `access VLAN N` carries N, and anything called "staged" is **not** carried; * the two implementations are compared across 360 port states (mode × access VLAN × native VLAN × allowed list), the way `fabric-agreement` and `port-state-agreement` compare their mirrors. `test/ui-render.test.js` now asserts the console's words (`access VLAN 20`) rather than the old panel spelling.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jaylouisw/packetforge#1291
No description provided.