The inspector header counts what can carry, not what is enabled (#1299) #1300
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge!1300
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/inspector-port-count"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The inspector header counts ports that can carry, not ports that are enabled.
Fixes #1299.
The defect
renderDeviceTab()drew28 ports · 28 upon a switch with nothing plugged in — the count was ofenabledand the word was "up". Two lines above, the front panel painted every socket
notconnect, and the console saiddown (no cable)for all 28. Three surfaces, two answers, and the wrong one was the summary: the single linepeople read.
Worse than the empty case — it also counted as up a port whose peer had shut down (
down (peer shut down), thetop cause of "the link is up but nothing passes") and a port whose cable had been taken down (
down (link down)); and it dropped shut ports from the accounting instead of naming them, so28 ports · 27 uptold youneither that 27 were dead nor that one was administratively down.
Measured before the fix — panel vs
show ip interface briefon a CX 6000:The rule already existed and every other surface used it (
PFFaceplate.portState/portVerdict, #1238). Theheader was the one place that re-derived the answer.
After
portVerdict()the rows, faceplate, tooltip and status bar use;summary cannot disagree with the rows under it;
faceplate.jsfailed to load) the header saysunknown (no state rule loaded)instead of falling back to
enabled, the guess that caused this.Evidence
test/inspector-port-count.test.js— 10 checks over 7 situations (nothing plugged in, live cable, dead peer, linkdown, cabled port shut, a mixture, a router):
1 port, and the no-rule fallback.With
web/app.jsreverted, 5 of the 10 fail — the up-count check reports all seven situations wrong, e.g.router-cabled: header says 3 up, console says 1.docs/LINK-STATE.md: the header added to the table of callers of the rule, and a section on why a summary thatguesses is worse than one that admits it cannot tell.
Suite: 165 suites, 6,777 assertions, 0 failed.