a bundle's members are checked against each other when the bundle is built (#1524) #1531

Merged
jaylouisw merged 1 commit from fix/1115-1848 into main 2026-11-15 19:16:28 +00:00
Owner

Fixes #1524

engine/lag.js validates each member's rate, duplex and VLAN set, but the one caller that builds a bundle - the channel-group handler - passed no memberPorts, so every per-member loop was skipped. A bundle of ports that cannot carry traffic the same way was accepted with a receipt and no word; the mismatch then surfaced as intermittent, half-working traffic that show etherchannel summary reads as healthy, because every member is up.

What changed:

  • CliSession._lagMemberPorts() resolves a record per member: the rate the port will run at (a forced speed, else the catalogue rate), its duplex, whether it is administratively up, and whether engine/vlan.js says it files frames the same way as the first member. The VLAN verdict is not re-derived here - framesCompatible() already owns that rule.
  • validateLag() is called with those records, and the first warning is printed as well as the first error: a shut member carries nothing, and the moment the port joins is when the operator is looking at it.
  • The group's id travels with the object. config.lags is keyed by the number typed but the object carried none, so normalizeLag() fell back to lag1 and every message would have named a group that does not exist.
  • E_LAG_DUPLEX_MISMATCH sorts its settings, the way the rate message already sorted: one bundle must not be described two ways depending on which member was typed first.

A correct bundle stays silent - the existing lag-mode guarantee - and that is asserted.

test/lag-member-checks.test.js (8 assertions) locks mixed rates, mixed duplex, different VLAN sets, a shut member, the group number in the sentence, and silence on a healthy bundle.

Gates: node scripts/syntax-check.js 321 files OK; npm test 251 suites, 9201 assertions, 0 failed.

Still dead, not in this change: the cable-level E_LAG_SPEED_MISMATCH in validation.js reads dev.lags (nothing creates it) and needs iface.lagId (nothing sets it) - recorded as a follow-up rather than fixed blind.

Fixes #1524 `engine/lag.js` validates each member's rate, duplex and VLAN set, but the one caller that builds a bundle - the `channel-group` handler - passed no `memberPorts`, so every per-member loop was skipped. A bundle of ports that cannot carry traffic the same way was accepted with a receipt and no word; the mismatch then surfaced as intermittent, half-working traffic that `show etherchannel summary` reads as healthy, because every member is up. What changed: * `CliSession._lagMemberPorts()` resolves a record per member: the rate the port will run at (a forced `speed`, else the catalogue rate), its duplex, whether it is administratively up, and whether `engine/vlan.js` says it files frames the same way as the first member. The VLAN verdict is not re-derived here - `framesCompatible()` already owns that rule. * `validateLag()` is called with those records, and the first warning is printed as well as the first error: a shut member carries nothing, and the moment the port joins is when the operator is looking at it. * The group's id travels with the object. `config.lags` is keyed by the number typed but the object carried none, so `normalizeLag()` fell back to `lag1` and every message would have named a group that does not exist. * `E_LAG_DUPLEX_MISMATCH` sorts its settings, the way the rate message already sorted: one bundle must not be described two ways depending on which member was typed first. A correct bundle stays silent - the existing `lag-mode` guarantee - and that is asserted. `test/lag-member-checks.test.js` (8 assertions) locks mixed rates, mixed duplex, different VLAN sets, a shut member, the group number in the sentence, and silence on a healthy bundle. Gates: `node scripts/syntax-check.js` 321 files OK; `npm test` 251 suites, 9201 assertions, 0 failed. Still dead, not in this change: the cable-level `E_LAG_SPEED_MISMATCH` in `validation.js` reads `dev.lags` (nothing creates it) and needs `iface.lagId` (nothing sets it) - recorded as a follow-up rather than fixed blind.
a bundle's members are checked against each other when the bundle is built (#1524)
All checks were successful
CI / Classify the change (pull_request) Successful in 17s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 34s
CI / Test (Node 18) (pull_request) Successful in 3m41s
CI / Test (Node 20) (pull_request) Successful in 3m15s
CI / Server smoke test (pull_request) Successful in 31s
CI / Docker build (pull_request) Successful in 45s
CI / Test (Node 22) (pull_request) Successful in 3m8s
968d194567
validateLag()'s per-member rules were unreachable: the only caller that
builds a bundle passed no memberPorts, so the rate, duplex and VLAN loops
were skipped and a bundle of mismatched ports was accepted silently. The
console now resolves a record per member - the rate it will run at, its
duplex, and whether engine/vlan.js says it files frames the same way as
the first member - and prints the first error or warning it finds.

The group's own id travels with the object too: config.lags is keyed by
the number typed but the object carried no id, so every message would
have named the default 'lag1' instead of group 1.
jaylouisw scheduled this pull request to auto merge when all checks succeed 2026-11-15 19:16:16 +00:00
jaylouisw force-pushed fix/1115-1848 from 968d194567
All checks were successful
CI / Classify the change (pull_request) Successful in 17s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 34s
CI / Test (Node 18) (pull_request) Successful in 3m41s
CI / Test (Node 20) (pull_request) Successful in 3m15s
CI / Server smoke test (pull_request) Successful in 31s
CI / Docker build (pull_request) Successful in 45s
CI / Test (Node 22) (pull_request) Successful in 3m8s
to 55cca52db0
Some checks failed
CI / Classify the change (pull_request) Successful in 16s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 20s
CI / Test (Node 20) (pull_request) Failing after 3m17s
CI / Test (Node 18) (pull_request) Failing after 3m31s
CI / Server smoke test (pull_request) Successful in 28s
CI / Docker build (pull_request) Successful in 46s
CI / Test (Node 22) (pull_request) Failing after 3m11s
2026-11-15 19:16:17 +00:00
Compare
Sign in to join this conversation.
No reviewers
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!1531
No description provided.