cli(trunk): a pair of VLAN ids prints as two ids, not a range #2414

Merged
jaylouisw merged 1 commit from rev/1121-1128 into main 2026-11-21 11:46:22 +00:00
Owner

Question. A trunk's allowed list is printed folded into ranges (1-4,7,11,13-4094). When two consecutive ids meet — 157 and 158 — does the box write 157-158, or two ids?

Verdict: two ids. Three show running-config captures spell pairs out — 1,81,82,171,999 (Cisco support doc 68100, w-backbone-6k), 59,157,158,160 (MEXSWP04-NAP#sh run int fa2/0/39, a 3750 stack) and 55,56,59,155,157,158,160,200 (MEXSW09-NAP#sh run int gi1/0/3) — while the c3550 TAC transcript folds a run of four (1-4,7,11,13-4094). The rule the samples fit is arithmetic: a range is written only where it is shorter than the comma list it replaces, so three or more consecutive ids fold and a pair does not (81-82 is exactly as long as 81,82).

Change. formatVlanList() in engine/vlan.js emits a range only for three-plus; web/app.js's panel mirror follows. A backup of a port carrying 157 and 158 now reads switchport trunk allowed vlan 59,157,158,160 instead of 59,157-158,160, and the console receipt and the switchport: sentence match it.

Tests. test/running-config-allowed-vlan-two-id-run.test.js (12 checks: three captured pairs character for character, a run of three folding, a run of four folding, the whole five-line fa2/0/39 block, the long gi1/0/3 list, receipt/sentence/config agreement, re-typing the printed line). test/trunk-allowed-remove-from-all.test.js (47 checks; the assertion that pinned the old guess now pins the capture). test/switchport-agreement.test.js gained pair-bearing lists and a range reader (13 checks). Full suite: 447 suites, 15,139 assertions, 0 failed.

Unresolved. A device-computed run of exactly three (the 1-3,100 sample may have been typed as a range) — a show running-config after a remove leaving three consecutive ids would settle it. Recorded in research/trunk-allowed-two-id-run.md.

**Question.** A trunk's allowed list is printed folded into ranges (`1-4,7,11,13-4094`). When two consecutive ids meet — `157` and `158` — does the box write `157-158`, or two ids? **Verdict: two ids.** Three `show running-config` captures spell pairs out — `1,81,82,171,999` (Cisco support doc 68100, `w-backbone-6k`), `59,157,158,160` (`MEXSWP04-NAP#sh run int fa2/0/39`, a 3750 stack) and `55,56,59,155,157,158,160,200` (`MEXSW09-NAP#sh run int gi1/0/3`) — while the c3550 TAC transcript folds a run of four (`1-4,7,11,13-4094`). The rule the samples fit is arithmetic: a range is written only where it is shorter than the comma list it replaces, so three or more consecutive ids fold and a pair does not (`81-82` is exactly as long as `81,82`). **Change.** `formatVlanList()` in `engine/vlan.js` emits a range only for three-plus; `web/app.js`'s panel mirror follows. A backup of a port carrying 157 and 158 now reads `switchport trunk allowed vlan 59,157,158,160` instead of `59,157-158,160`, and the console receipt and the `switchport:` sentence match it. **Tests.** `test/running-config-allowed-vlan-two-id-run.test.js` (12 checks: three captured pairs character for character, a run of three folding, a run of four folding, the whole five-line `fa2/0/39` block, the long `gi1/0/3` list, receipt/sentence/config agreement, re-typing the printed line). `test/trunk-allowed-remove-from-all.test.js` (47 checks; the assertion that pinned the old guess now pins the capture). `test/switchport-agreement.test.js` gained pair-bearing lists and a range reader (13 checks). Full suite: **447 suites, 15,139 assertions, 0 failed**. **Unresolved.** A *device-computed* run of exactly three (the `1-3,100` sample may have been typed as a range) — a `show running-config` after a `remove` leaving three consecutive ids would settle it. Recorded in `research/trunk-allowed-two-id-run.md`.
cli(trunk): a pair of VLAN ids prints as two ids, not a range
All checks were successful
CI / Server smoke and Docker build (pull_request) Successful in 24s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 5s
CI / Test (Node 20) (pull_request) Successful in 1m1s
CI / Test (Node 22) (pull_request) Successful in 1m1s
CI / Test (Node 18) (pull_request) Successful in 1m3s
CI / Arm auto-merge (pull_request) Successful in 3s
fcdc206ef4
Three show running-config captures (Cisco doc 68100, and two Catalyst 3750-stack backups) print 81,82 / 157,158 / 55,56 unfolded while the c3550 folds runs of four. A range is only written where it is shorter than the list it replaces, so three or more consecutive ids fold. formatVlanList() and the panel mirror follow it; research/trunk-allowed-two-id-run.md and test/running-config-allowed-vlan-two-id-run.test.js pin it.
forgejo-actions scheduled this pull request to auto merge when all checks succeed 2026-11-21 11:30:41 +00:00
jaylouisw force-pushed rev/1121-1128 from fcdc206ef4
All checks were successful
CI / Server smoke and Docker build (pull_request) Successful in 24s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 5s
CI / Test (Node 20) (pull_request) Successful in 1m1s
CI / Test (Node 22) (pull_request) Successful in 1m1s
CI / Test (Node 18) (pull_request) Successful in 1m3s
CI / Arm auto-merge (pull_request) Successful in 3s
to 0c0c721458
All checks were successful
CI / Server smoke and Docker build (pull_request) Successful in 28s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 6s
CI / Test (Node 22) (pull_request) Successful in 1m1s
CI / Test (Node 20) (pull_request) Successful in 1m1s
CI / Test (Node 18) (pull_request) Successful in 1m2s
CI / Arm auto-merge (pull_request) Successful in 3s
2026-11-21 11:44:41 +00:00
Compare
jaylouisw deleted branch rev/1121-1128 2026-11-21 11:46:25 +00:00
Sign in to join this conversation.
No reviewers
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!2414
No description provided.