cli(stp): a bridge priority off the 4096 ladder draws the box's own four lines #2399

Merged
jaylouisw merged 1 commit from rev/1121-0912 into main 2026-11-21 09:41:59 +00:00
Owner

Question. A bridge priority inside 0-61440 but not a multiple of 4096 is refused, not rounded. What exactly does the box print?

Verdict: known and adopted. Four lines - the value check's sentence, its heading, and its sixteen allowed values eight to a line in a six-character column:

% Bridge Priority must be in increments of 4096.
% Allowed values are:
0     4096  8192  12288 16384 20480 24576 28672
32768 36864 40960 45056 49152 53248 57344 61440

The console used to print its own explanation ("it must be a multiple of 4096 ... the nearest valid values are 4096 and 8192"). The rejected number is not echoed by a box, so it is not echoed here either.

Sources. Catalyst 4500 config guides 12.2(37)SG and IOS XE 3.9.xE - PDFs whose Courier text layer keeps the column (0 in a six-wide field, so 4096 starts under 32768); the 12.2(20)EWA/31SG/50SG HTML books; a Cisco Community PVST+ transcript for spanning-tree vlan 10 priority 100; Cisco Learning Network for the per-VLAN form. The same block from the per-VLAN and MST forms makes it the value check's message, not the command's.

Changed. engine/cli.js: in-range but off-ladder now returns those four lines (range check still first, so 61441 still names the range - the #1505 fix is preserved). Regression in test/stp-priority.test.js pins the four lines byte for byte, asserts the rejected number is absent, and replays all sixteen listed values to prove none is itself refused. test/command-answers-the-question.test.js moved to the new wording; docs/CLI.md "Setting the root" quotes the block; research/stp-priority-step-refusal.md carries the evidence and the open questions.

Open. The wrap at a non-default terminal width (a 2025 paste shows all sixteen on one line) and whether the rows are indented (PDF extraction trims leading spaces). The out-of-range refusal remains this console's own sentence.

Tests. node scripts/syntax-check.js OK (522 files); npm test: 442 suites, 14,911 assertions, 0 failed.

**Question.** A bridge priority inside 0-61440 but not a multiple of 4096 is refused, not rounded. What exactly does the box print? **Verdict: known and adopted.** Four lines - the value check's sentence, its heading, and its sixteen allowed values eight to a line in a six-character column: ``` % Bridge Priority must be in increments of 4096. % Allowed values are: 0 4096 8192 12288 16384 20480 24576 28672 32768 36864 40960 45056 49152 53248 57344 61440 ``` The console used to print its own explanation ("it must be a multiple of 4096 ... the nearest valid values are 4096 and 8192"). The rejected number is not echoed by a box, so it is not echoed here either. **Sources.** Catalyst 4500 config guides 12.2(37)SG and IOS XE 3.9.xE - PDFs whose Courier text layer keeps the column (0 in a six-wide field, so 4096 starts under 32768); the 12.2(20)EWA/31SG/50SG HTML books; a Cisco Community PVST+ transcript for `spanning-tree vlan 10 priority 100`; Cisco Learning Network for the per-VLAN form. The same block from the per-VLAN and MST forms makes it the value check's message, not the command's. **Changed.** engine/cli.js: in-range but off-ladder now returns those four lines (range check still first, so 61441 still names the range - the #1505 fix is preserved). Regression in test/stp-priority.test.js pins the four lines byte for byte, asserts the rejected number is absent, and replays all sixteen listed values to prove none is itself refused. test/command-answers-the-question.test.js moved to the new wording; docs/CLI.md "Setting the root" quotes the block; research/stp-priority-step-refusal.md carries the evidence and the open questions. **Open.** The wrap at a non-default `terminal width` (a 2025 paste shows all sixteen on one line) and whether the rows are indented (PDF extraction trims leading spaces). The out-of-range refusal remains this console's own sentence. **Tests.** node scripts/syntax-check.js OK (522 files); npm test: 442 suites, 14,911 assertions, 0 failed.
cli(stp): a bridge priority off the 4096 ladder draws the box's own four lines
All checks were successful
CI / Classify the change (pull_request) Successful in 10s
CI / Server smoke and Docker build (pull_request) Successful in 25s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 6s
CI / Test (Node 20) (pull_request) Successful in 56s
CI / Test (Node 22) (pull_request) Successful in 58s
CI / Test (Node 18) (pull_request) Successful in 59s
CI / Arm auto-merge (pull_request) Successful in 2s
f7d6bc05db
`spanning-tree priority 4500` answered with a sentence this console wrote:
"% 4500 is not a valid bridge priority: it must be a multiple of 4096 ...
the nearest valid values are 4096 and 8192". True, but no box prints it. A
Catalyst prints the value check's own message - two sentences and its sixteen
allowed values, eight to a line in a six-character column:

  % Bridge Priority must be in increments of 4096.
  % Allowed values are:
  0     4096  8192  12288 16384 20480 24576 28672
  32768 36864 40960 45056 49152 53248 57344 61440

The column comes from two Catalyst 4500 configuration-guide PDFs whose
Courier text layer survives extraction; the same block appears for the
per-VLAN and MST instance forms, so it is the value check's, not the
command's. The rejected number is not echoed, and neither does this console
echo it now.

The out-of-range refusal (61441) is untouched: the captures are of the step
check, not of IOS's parser refusing a value outside <0-61440>.

Regression: test/stp-priority.test.js pins all four lines byte for byte and
replays all sixteen listed values, so the table cannot offer one the check
refuses (the #1505 defect in longer form). research/stp-priority-step-refusal.md
records the sources and the wrap/indent questions left open.
forgejo-actions scheduled this pull request to auto merge when all checks succeed 2026-11-21 09:23:02 +00:00
jaylouisw deleted branch rev/1121-0912 2026-11-21 09:42:03 +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!2399
No description provided.