The inspector's port shutdown toggle 404s on every port name with a slash, and a link-state response shadows state #1307
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge#1307
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Found while auditing that every state payload carries the same shape after #1304/#1305. It is unrelated to that
work and much worse.
1. The inspector's shutdown toggle does nothing on most of the catalogue
POST /api/topologies/:name/interfaces/:device/:portrequired exactly one path segment for the port(
parts.length === 6). But a port name is1/1/1,Fa0/1,Gi0/0/2— it contains slashes. So the URL the UIbuilds splits into extra segments and the endpoint never matches. Measured against a live server:
The plain form falls through to the 404 at the bottom of the router; the encoded form reaches the handler but is
never decoded. So the ▲/▼ shutdown control in the inspector — rendered, wired, and inert — has never worked for
any device whose port names use slashes, which is most of the catalogue. Nothing caught it because every test
drives the engine directly, not the URL.
2.
stateappears twice in one response objectPOST /api/topologies/:name/links/:id/statereturns:The link's own
'up'/'down'string and the whole topology under the same key. It currently works by luck:JavaScript keeps the later key. Reorder those lines, or delete the second, and the entire UI stores
state: "down"and blanks the board.What must be true instead
reaching the same port, and the port actually changing state;
linkState, sostatemeans one thing: the topology payload thatevery other endpoint returns;
really down afterwards — the class of bug that only a request-level test catches.
Also checked in the same pass
Every state payload comes from
fullState()(structurally, over the source, and over HTTP for every endpoint thatreturns one), the WebSocket connect frame and every broadcast carry the same shape, and the per-payload cost of
the cable verdicts stays inside a budget (5.3 ms for a 200-cable lab, against a 60 ms tripwire).
state(#1307) #1308a bcannot be reached #1315