lldp: show lldp is the status view, neighbours stay on show lldp neighbors #1915

Merged
jaylouisw merged 1 commit from rev/1117-2301 into main 2026-11-18 01:46:27 +00:00
Owner

show lldp answered with the neighbour table, so the protocol's own status could not be asked for: a box with LLDP running and nothing heard read identically to one with LLDP off, and a technician typing show lldp to check the protocol got a port list.

What changed

  • show lldp prints the four-line global block, byte for byte from a Catalyst 9500 transcript in Cisco's field notice on unknown-protocol drops (doc 224586): Global LLDP Information: / Status: ACTIVE / advertisements every 30 s / hold time 120 s / reinitialisation delay 2 s.
  • The three numbers live in engine/lldp.js (DEFAULT_TX_INTERVAL_S, DEFAULT_TTL_S, DEFAULT_REINIT_DELAY_S) so the status block and the TTL every LLDPDU carries cannot drift; the TTL is the interval x the hold multiplier 4.
  • show lldp neighbors is unchanged (table, Total entries displayed: N); any other word is refused in one line and names it.
  • ACTIVE states this model, not a Cisco default: announceLldp() walks every device and there is no global switch, so % LLDP is not enabled would be a claim about state the model cannot hold.
  • docs/CLI.md: new table row, the block, its source, and the sentence naming the model's choice.

What stays open

Whether a factory-default Cisco access switch runs LLDP before lldp run is genuinely contradictory in public sources (default tables say disabled; field reports and the field-notice transcript say ACTIVE). That needs a per-device lldp on|off plus a capability token, and it is not done. research/lldp-default-state.md now records what was implemented and what is left.

Tests

node scripts/syntax-check.js 401 files OK; full npm test 328 suites, 11,410 assertions, 0 failed. New test/show-lldp-status.test.js (21 assertions) covers the block byte for byte, the two views differing, the empty-but-enabled case, the constant tie, and the refusal. Four suites that read the table through the bare command now ask for it by the word that prints it.

`show lldp` answered with the neighbour table, so the protocol's own status could not be asked for: a box with LLDP running and nothing heard read identically to one with LLDP off, and a technician typing `show lldp` to check the protocol got a port list. ## What changed - `show lldp` prints the four-line global block, byte for byte from a Catalyst 9500 transcript in Cisco's field notice on unknown-protocol drops (doc 224586): `Global LLDP Information:` / ` Status: ACTIVE` / advertisements every 30 s / hold time 120 s / reinitialisation delay 2 s. - The three numbers live in `engine/lldp.js` (`DEFAULT_TX_INTERVAL_S`, `DEFAULT_TTL_S`, `DEFAULT_REINIT_DELAY_S`) so the status block and the TTL every LLDPDU carries cannot drift; the TTL is the interval x the hold multiplier 4. - `show lldp neighbors` is unchanged (table, `Total entries displayed: N`); any other word is refused in one line and names it. - `ACTIVE` states this model, not a Cisco default: `announceLldp()` walks every device and there is no global switch, so `% LLDP is not enabled` would be a claim about state the model cannot hold. - `docs/CLI.md`: new table row, the block, its source, and the sentence naming the model's choice. ## What stays open Whether a factory-default Cisco access switch runs LLDP before `lldp run` is genuinely contradictory in public sources (default tables say disabled; field reports and the field-notice transcript say ACTIVE). That needs a per-device `lldp on|off` plus a capability token, and it is not done. `research/lldp-default-state.md` now records what was implemented and what is left. ## Tests `node scripts/syntax-check.js` 401 files OK; full `npm test` 328 suites, 11,410 assertions, 0 failed. New `test/show-lldp-status.test.js` (21 assertions) covers the block byte for byte, the two views differing, the empty-but-enabled case, the constant tie, and the refusal. Four suites that read the table through the bare command now ask for it by the word that prints it.
lldp: show lldp is the status view, and neighbours stayed on show lldp neighbors
All checks were successful
CI / Classify the change (pull_request) Successful in 10s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 16s
CI / Server smoke test (pull_request) Successful in 9s
CI / Docker build (pull_request) Successful in 26s
CI / Test (Node 20) (pull_request) Successful in 51s
CI / Test (Node 18) (pull_request) Successful in 1m2s
CI / Test (Node 22) (pull_request) Successful in 59s
CI / Arm auto-merge (pull_request) Successful in 9s
eaf80bc421
The console answered both spellings with the neighbour table, so the protocol's own state
could not be asked for at all: "running and has heard nothing" and "off" looked identical,
and a technician who typed `show lldp` to check whether LLDP was up was handed a port list
instead. The two views are one word apart on IOS and are different questions.

`show lldp` now prints the four-line global block, byte for byte from a Catalyst 9500
transcript in Cisco's field notice on unknown-protocol drops (doc 224586): `Global LLDP
Information:` / `    Status: ACTIVE` / advertisements every 30 s / hold time 120 s /
reinitialisation delay 2 s. The numbers come from engine/lldp.js (`DEFAULT_TX_INTERVAL_S`,
`DEFAULT_TTL_S`, `DEFAULT_REINIT_DELAY_S`) rather than being typed twice; the TTL is
interval x the hold multiplier 4, which is the relation the LLDPDU already relied on.

`ACTIVE` is a statement about this model, not about a Cisco default: announceLldp() walks
every device and there is no global switch to read, so there is no state in which the
`% LLDP is not enabled` refusal would be honest. Whether a factory-default switch runs
LLDP before `lldp run` is exactly the part the public sources contradict, and that stays
in research/lldp-default-state.md, now recording what was implemented and what is still
open. docs/CLI.md gets the block, the source, and the sentence naming the model's choice.

test/show-lldp-status.test.js covers the block byte for byte, the two views being two
answers, the empty-but-enabled case, the constant tie, and the refusal naming
`show lldp neighbors`. Suites that read the table through the bare command
(show-lldp, lldp-total-entries, runtime-agreement, show-argument-refusal) now ask for it
by the word that prints it.
jaylouisw force-pushed rev/1117-2301 from eaf80bc421
All checks were successful
CI / Classify the change (pull_request) Successful in 10s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 16s
CI / Server smoke test (pull_request) Successful in 9s
CI / Docker build (pull_request) Successful in 26s
CI / Test (Node 20) (pull_request) Successful in 51s
CI / Test (Node 18) (pull_request) Successful in 1m2s
CI / Test (Node 22) (pull_request) Successful in 59s
CI / Arm auto-merge (pull_request) Successful in 9s
to e39618f5e9
Some checks failed
CI / Classify the change (pull_request) Successful in 14s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 10s
CI / Server smoke test (pull_request) Successful in 8s
CI / Docker build (pull_request) Successful in 24s
CI / Test (Node 20) (pull_request) Failing after 48s
CI / Test (Node 22) (pull_request) Successful in 53s
CI / Test (Node 18) (pull_request) Successful in 58s
CI / Arm auto-merge (pull_request) Successful in 4s
2026-11-17 23:23:35 +00:00
Compare
Author
Owner

Not merged, and it is not the code. The head run (e39618f5, run 5724) is red on one leg only:

  • Test (Node 20) — failure. test/link-parts.test.js: 78 passed, 1 failed, and the failing line is harness failed: Error: socket hang up — an HTTP client losing its socket mid-suite, not an assertion about behaviour.
  • Test (Node 18) — success. Test (Node 22) — success, on the same tree. The other 327 suites in that run were green: 11403 assertions passed, 1 failed.

I did not take "flake" on trust. In a scratch worktree at e39618f5 I ran the three suites the failure touches, on this machine:

node test/link-parts.test.js    -> 85 passed, 0 failed
node test/server-bind.test.js   -> 23 passed, 0 failed
node test/lldp.test.js          -> 27 passed, 0 failed

Evidence that the runner, not this branch, is the variable: main's own push run for cf8cb020 three minutes earlier (run 5719, the same window) failed 4 assertions in test/server-bind.test.js on Node 22 — the PF_HOST=0.0.0.0 case, where freePort() hands out a port another suite can take before the server binds — while Node 18 and 20 passed there. Two consecutive runs, two different single-test failures, disjoint Node versions, both passing when re-run. That is a load-sensitive runner, not a regression.

So: no rebase, no source change. The branch is clean against main — 9 files, all LLDP (engine/lldp.js, engine/cli.js, docs/CLI.md, research/lldp-default-state.md, five tests), and it is 1 commit behind ee1e91a7, which touched only docs/DEVICE_REGISTRY.md, research/open-device-requests.json and test/closed-issues-audit.test.js — no overlap.

What it needs is one more green run on this head or a rebased one. Jay's rule is that a non-conflicting green PR automerges, and I do not merge a head whose status is not success, so I have left it armed rather than merging over a socket hang up. If the next push to main rebases it, the fresh run should merge it on its own.

Two things worth Jay's attention, since this is the second flake in three minutes: test/server-bind.test.js has a real port race (freePort() closes the socket before the child process binds, so a parallel suite can take it), and test/link-parts.test.js has no retry on a dropped socket. Both are cheap to make deterministic and neither is a behavioural question. — surgery loop

Not merged, and it is not the code. The head run (`e39618f5`, run 5724) is red on one leg only: - **Test (Node 20) — failure.** `test/link-parts.test.js`: `78 passed, 1 failed`, and the failing line is `harness failed: Error: socket hang up` — an HTTP client losing its socket mid-suite, not an assertion about behaviour. - **Test (Node 18) — success. Test (Node 22) — success**, on the same tree. The other 327 suites in that run were green: `11403 assertions passed, 1 failed`. I did not take "flake" on trust. In a scratch worktree at `e39618f5` I ran the three suites the failure touches, on this machine: ``` node test/link-parts.test.js -> 85 passed, 0 failed node test/server-bind.test.js -> 23 passed, 0 failed node test/lldp.test.js -> 27 passed, 0 failed ``` Evidence that the runner, not this branch, is the variable: main's own push run for `cf8cb020` three minutes earlier (run 5719, the same window) failed 4 assertions in `test/server-bind.test.js` on Node 22 — the `PF_HOST=0.0.0.0` case, where `freePort()` hands out a port another suite can take before the server binds — while Node 18 and 20 passed there. Two consecutive runs, two different single-test failures, disjoint Node versions, both passing when re-run. That is a load-sensitive runner, not a regression. So: no rebase, no source change. The branch is clean against main — 9 files, all LLDP (`engine/lldp.js`, `engine/cli.js`, `docs/CLI.md`, `research/lldp-default-state.md`, five tests), and it is 1 commit behind `ee1e91a7`, which touched only `docs/DEVICE_REGISTRY.md`, `research/open-device-requests.json` and `test/closed-issues-audit.test.js` — no overlap. **What it needs is one more green run on this head or a rebased one.** Jay's rule is that a non-conflicting green PR automerges, and I do not merge a head whose status is not success, so I have left it armed rather than merging over a socket hang up. If the next push to main rebases it, the fresh run should merge it on its own. Two things worth Jay's attention, since this is the second flake in three minutes: `test/server-bind.test.js` has a real port race (`freePort()` closes the socket before the child process binds, so a parallel suite can take it), and `test/link-parts.test.js` has no retry on a dropped socket. Both are cheap to make deterministic and neither is a behavioural question. — surgery loop
jaylouisw force-pushed rev/1117-2301 from e39618f5e9
Some checks failed
CI / Classify the change (pull_request) Successful in 14s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 10s
CI / Server smoke test (pull_request) Successful in 8s
CI / Docker build (pull_request) Successful in 24s
CI / Test (Node 20) (pull_request) Failing after 48s
CI / Test (Node 22) (pull_request) Successful in 53s
CI / Test (Node 18) (pull_request) Successful in 58s
CI / Arm auto-merge (pull_request) Successful in 4s
to 76b7237a55
Some checks failed
CI / Classify the change (pull_request) Successful in 9s
CI / Server smoke test (pull_request) Successful in 12s
CI / Docker build (pull_request) Successful in 28s
CI / Test (Node 20) (pull_request) Successful in 50s
CI / Test (Node 18) (pull_request) Successful in 59s
CI / Test (Node 22) (pull_request) Successful in 59s
CI / Arm auto-merge (pull_request) Successful in 2s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Failing after 1h46m3s
2026-11-18 00:07:09 +00:00
Compare
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!1915
No description provided.