A mask the console refuses is refused by every door (#1413) #1414
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!1414
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/api-config-door"
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?
Closes #1413.
The endpoint asks the rule, not the parser.
isIp()for the address,isContiguousMask()for the mask, and a refusal carries a code a client can act on -E_BAD_ADDRESS,E_BAD_MASK- with a sentence that says what a netmask is. A refused request changes nothing.One intent, one spelling. A prefix length (
"24") is rewritten to255.255.255.0before it is stored, which is what the console already did; the two doors had been disagreeing about the same command.A loaded document is restored or explained.
fromJSON()sweeps each port's address after hydration and records one entry per port inloadIssues, the channel cables already use: an old"24"is rewritten and the address kept; a mask that is not a mask, an address that cannot exist, or an address with no mask cost the port its address and say so by name -E_IFACE_BAD_MASK,E_IFACE_BAD_ADDRESS,E_IFACE_NO_MASK. The rest of the lab loads, instead of the whole document being refused with the engine's wording (400 Invalid IPv4 address: 300.1.1.1, board never replaced).Evidence.
test/api-config-door.test.js, 24 checks against a real server on a temp data dir:E_BAD_MASKwith a sentence about netmasks, and the port is untouched;E_BAD_ADDRESS, and nothing is set;mask: "24"is accepted and stored dotted, so the config printsip address 10.5.5.1 255.255.255.0and the port reads/24;ip addressline is typed back into the console and no refusal is allowed (the property that was broken);loadIssuesnaming port and value, rewrites the old spelling, leaves the good port alone, and leaves no impossible mask in state;loadIssues.Reverting
server/index.jsfails 8 of 24; revertingengine/topology.jsfails 2 of 24. Suite: 208 suites, 7,989 assertions, 0 failed; syntax 276 files OK.Docs:
docs/ARCHITECTURE.mdgains "A mask the console refuses is refused by every door" and "An address is restored or explained".