no channel-group 9999 removes the port from the bundle it is really in #1510

Closed
opened 2026-11-12 10:02:11 +00:00 by jaylouisw · 0 comments
Owner

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 no that names one group removes another — and it is the destructive one.

sw1(config-if)#channel-group 2 mode active
Interface Fa0/1 added to channel group 2 (mode active)

sw1(config-if)#no channel-group 9999
Fa0/1 removed from channel group 2 (the group had no other members)      ← the id was never read

The dispatcher threw the word away (this._channelGroup(['remove'], iface)), so every no 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.

interface Fa0/1 ; channel-group 100 mode active
interface Fa0/1 ; channel-group 2   mode active
interface Fa0/1 ; channel-group 10  mode active
→ show etherchannel summary lists Fa0/1 as a member of 100, 2 and 10

On IOS a second channel-group moves the port. Here it added membership to each group in turn, so one cable
appeared 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() gave 10, 100, 2. Bundle ids are numbers and a
technician reads that column as a list; show access-lists already sorts with a numeric comparator.

What changes

  • engine/cli.js: no channel-group <id> reads the id, range-checks it, and answers Fa0/1 is not in channel group 5: it is in group 2 instead of acting on group 2; the bare no channel-group keeps its old meaning ("whatever it is
    in"), 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-group no, the move, and the order.

Verification

no-command-touches-only-what-it-names 11/11; with the previous handler 8 passed / 3 failed, the three
failures being exactly these. Full suite 251 suites / 9213 assertions / 0 failed; syntax 321 files;
config-undo 48/48; stated-range-is-the-enforced-range 10/10; skip-audit 15/15.

Lands with the queue as land-all-v4.

## 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 `no` that names one group removes another — and it is the destructive one.** ``` sw1(config-if)#channel-group 2 mode active Interface Fa0/1 added to channel group 2 (mode active) sw1(config-if)#no channel-group 9999 Fa0/1 removed from channel group 2 (the group had no other members) ← the id was never read ``` The dispatcher threw the word away (`this._channelGroup(['remove'], iface)`), so every `no 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.** ``` interface Fa0/1 ; channel-group 100 mode active interface Fa0/1 ; channel-group 2 mode active interface Fa0/1 ; channel-group 10 mode active → show etherchannel summary lists Fa0/1 as a member of 100, 2 and 10 ``` On IOS a second `channel-group` **moves** the port. Here it added membership to each group in turn, so one cable appeared 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()` gave `10, 100, 2`. Bundle ids are numbers and a technician reads that column as a list; `show access-lists` already sorts with a numeric comparator. ## What changes - `engine/cli.js`: `no channel-group <id>` reads the id, range-checks it, and answers `Fa0/1 is not in channel group 5: it is in group 2` instead of acting on group 2; the bare `no channel-group` keeps its old meaning ("whatever it is in"), 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-group `no`, the move, and the order. ## Verification `no-command-touches-only-what-it-names` **11/11**; with the previous handler **8 passed / 3 failed**, the three failures being exactly these. Full suite **251 suites / 9213 assertions / 0 failed**; syntax 321 files; `config-undo` 48/48; `stated-range-is-the-enforced-range` 10/10; `skip-audit` 15/15. Lands with the queue as `land-all-v4`.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jaylouisw/packetforge#1510
No description provided.