no channel-group 9999 removes the port from the bundle it is really in #1510
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge#1510
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?
What happens
Three defects in the link-aggregation handler, all of them "the command did not do what the words said", found by
reviewing the queued #1505 fix by typing at a device rather than reading the diff.
1. a
nothat names one group removes another — and it is the destructive one.The dispatcher threw the word away (
this._channelGroup(['remove'], iface)), so everyno channel-group <anything>removed the port from whatever bundle it really was in, and the id was never range-checked either. A technician
correcting a typo takes the port out of the bundle that is carrying traffic.
2. a port could be in several bundles at once.
On IOS a second
channel-groupmoves the port. Here it added membership to each group in turn, so one cableappeared in every bundle it had ever been joined to — a state no switch can be in, invented by commands that were
each typed correctly, and then reported by the view that is supposed to be the truth about bundles.
3. the bundle table was ordered as strings.
Object.keys().sort()gave10, 100, 2. Bundle ids are numbers and atechnician reads that column as a list;
show access-listsalready sorts with a numeric comparator.What changes
engine/cli.js:no channel-group <id>reads the id, range-checks it, and answersFa0/1 is not in channel group 5: it is in group 2instead of acting on group 2; the bareno channel-groupkeeps its old meaning ("whatever it isin"), because that is what you type when you do not remember.
engine/cli.js:channel-group <id>moves the port, saying so —Interface Fa0/1 moved from channel group 2 to 10.engine/cli.js: the summary sorts bundle ids numerically, in one place, where the list is built.test/no-command-touches-only-what-it-names.test.js: three checks — the wrong-groupno, the move, and the order.Verification
no-command-touches-only-what-it-names11/11; with the previous handler 8 passed / 3 failed, the threefailures being exactly these. Full suite 251 suites / 9213 assertions / 0 failed; syntax 321 files;
config-undo48/48;stated-range-is-the-enforced-range10/10;skip-audit15/15.Lands with the queue as
land-all-v4.channel-group 4097is accepted #1505no channel-groupundoes the group it names, and a port belongs to one bundle (#1510) #1543