Interface status now means "this port can carry a frame" (#1237) #1239
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!1239
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/interface-status-honest"
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?
Interface status now means "this port can carry a frame" (#1237)
Fixes #1237.
show ip interface briefanswered one question — did somebody shut this port — and printed the answerin the Status column. A port with no cable therefore reported
up / up, in the table people copy intobug reports when a link will not come up.
show interfaceswent further and contradicted itself twolines apart:
Now
A single
Device.ifaceStatus(iface, topo)answers the question once, and both commands use it:administratively downdownpeeris null)downdowndowndownup(its link is the radio)upupupshow interfacescarries the reason:status: down (no cable), protocol: down/status: down (peer shut down), protocol: down. The block can no longer saystatus: upabovepeer: disconnected.The topology is passed in explicitly, because it is the only thing that knows a cable is missing. A
device that was never put in a topology has no cables to report on, so it keeps its old answer — asserted
in the tests, so it stays a decision rather than drifting into a default.
Evidence
test/interface-status.test.js— 24 checks on a real two-router lab:down / down, and nothing can reach that address;down(notadministratively down— nobody shut ithere), a ping fails, and
show interfacesnamespeer shut down;administratively down;show interfacesblock saysdown (no cable)and never claims up while thepeer line says disconnected;
upwithout a topology and reportsdownwith one and no cable;actually carry a frame (own side enabled, peer exists and is enabled).
Reverting
engine/cli.js+engine/device.jsfails 10 of them.docs/CLI.mdgains "Readingshow ip interface brief" with the table above, the reason strings, thewireless carve-out and the no-topology limit.
Follow-up, not in this PR
The web UI still derives status from
enabledin three places —web/canvas.js:379(canvas tooltip),web/faceplate.js:477(port title) andweb/app.js:1586(inspector footer) — so an unplugged port onthe canvas is still described as healthy. That is the same defect on a different code path, and it needs
its own tests over the canvas's link model rather than the engine's
Topology; filed separately ratherthan bolted on here.
Suite: 133 suites, 5,817 assertions, 0 failed.