LAG: a MAC learned on the dead member is re-hashed onto a live one (#1515) #1605

Merged
jaylouisw merged 1 commit from fix/1116-0435 into main 2026-11-16 04:53:08 +00:00
Owner

Fixes #1515

What was wrong

A flood nominates every member of a bundle, so a two-member LAG survived losing a cable while every frame was a flood. A known unicast nominates exactly the port the MAC table names, and that list was handed to the hash as-is: if the table named the member whose cable had just been pulled, the pool had one candidate - one dead port - and the frame went there and was dropped link down while the live member sat idle.

Measured before the fix (a MAC learned on Fa0/3, cable pulled):

replies  false,false,false,false
picks    Fa0/3,Fa0/3,Fa0/3,Fa0/3
drops    {"link down":5}

So the bundle carried traffic until the first known-unicast frame, then stopped - the case bundles exist for.

What changed

  • The member pool for the hash is now every member of the bundle that may leave in this VLAN, not only the members this frame happened to nominate. Which member a frame arrived by, or which one the table remembers, does not decide which member carries the next frame.
  • The egress refusal (STP-blocked, outside the VLAN, ingress bundle) is one predicate, _egressRefusal(), read by both the nominated-port filter and the pool, so the two cannot drift apart.
  • With no member able to carry, the pick prefers a live member when one exists; when none does it still attempts one, so the frame is dropped with a reason a counter can print rather than vanishing into a bundle that looks healthy (#1258 behaviour kept).

After: replies true,true,true,true, every frame leaves by Fa0/2, and the exchange is never billed to the pulled cable.

Tests

New section in test/lag-member-down.test.js: A MAC the table learned on the member that then died moves to a live member (+4 assertions, 34 in the file). The first two assertions fail on the old code and pass on the new; the rest cover the flood path and the no-live-member accounting.

Gates: node scripts/syntax-check.js 333 files OK; full npm test 263 suites / 9552 assertions / 0 failed.

No new feature - the bundle's own rule, applied to the path that was not reading it.

Fixes #1515 ## What was wrong A flood nominates every member of a bundle, so a two-member LAG survived losing a cable **while every frame was a flood**. A known unicast nominates exactly the port the MAC table names, and that list was handed to the hash as-is: if the table named the member whose cable had just been pulled, the pool had one candidate - one dead port - and the frame went there and was dropped `link down` while the live member sat idle. Measured before the fix (a MAC learned on Fa0/3, cable pulled): replies false,false,false,false picks Fa0/3,Fa0/3,Fa0/3,Fa0/3 drops {"link down":5} So the bundle carried traffic until the first known-unicast frame, then stopped - the case bundles exist for. ## What changed - The member pool for the hash is now every member of the bundle that may leave in this VLAN, not only the members this frame happened to nominate. Which member a frame arrived by, or which one the table remembers, does not decide which member carries the next frame. - The egress refusal (STP-blocked, outside the VLAN, ingress bundle) is one predicate, `_egressRefusal()`, read by both the nominated-port filter and the pool, so the two cannot drift apart. - With no member able to carry, the pick prefers a live member when one exists; when none does it still attempts one, so the frame is dropped with a reason a counter can print rather than vanishing into a bundle that looks healthy (#1258 behaviour kept). After: `replies true,true,true,true`, every frame leaves by Fa0/2, and the exchange is never billed to the pulled cable. ## Tests New section in `test/lag-member-down.test.js`: *A MAC the table learned on the member that then died moves to a live member* (+4 assertions, 34 in the file). The first two assertions fail on the old code and pass on the new; the rest cover the flood path and the no-live-member accounting. Gates: `node scripts/syntax-check.js` 333 files OK; full `npm test` **263 suites / 9552 assertions / 0 failed**. No new feature - the bundle's own rule, applied to the path that was not reading it.
LAG: a MAC learned on a dead member is re-hashed onto a live one (#1515)
Some checks failed
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 36s
CI / Classify the change (pull_request) Failing after 12m23s
CI / Test (Node 18) (pull_request) Has been cancelled
CI / Test (Node 20) (pull_request) Has been cancelled
CI / Test (Node 22) (pull_request) Has been cancelled
CI / Server smoke test (pull_request) Has been cancelled
CI / Docker build (pull_request) Has been cancelled
993b9e1cf5
A flood nominates every member of a bundle, so a bundle survived losing a cable while every frame
was a flood. A known unicast nominates exactly the port the MAC table names, and the pool handed to
the hash was that list: if the table named the member whose cable had just been pulled, the bundle
had one candidate, one dead port, and no live member to choose - the frame went to Fa0/3 and was
dropped "link down" while Fa0/2 sat idle.

  both links up, table says Fa0/3
  Fa0/3 cable pulled   false,false,false,false  picks: Fa0/3,Fa0/3,Fa0/3,Fa0/3

The bundle is one logical port: which member a frame arrived by, or which member the table happens
to remember, does not decide which member carries the next frame. The member pool is now every
member of the bundle that may leave in this VLAN, so the hash re-hashes a known unicast onto a live
member. The egress refusal (STP, VLAN, ingress bundle) is pulled into one predicate, `_egressRefusal`,
read by both the nominated-port filter and the pool so the two cannot drift.

The old pool had a second way to lie: with no member able to carry it emitted `noLiveMember` and
then attempted `members[0]` regardless, which could be the dead member. It now prefers a live member
when one exists and still attempts one when none does, so the loss stays countable rather than
vanishing into a bundle that looks healthy.

Test: lag-member-down.test.js, +4 assertions (34 total). Full suite 263 suites / 9552 assertions, 0
failed; syntax check 333 files OK.
jaylouisw scheduled this pull request to auto merge when all checks succeed 2026-11-16 04:52:51 +00:00
jaylouisw force-pushed fix/1116-0435 from 993b9e1cf5
Some checks failed
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 36s
CI / Classify the change (pull_request) Failing after 12m23s
CI / Test (Node 18) (pull_request) Has been cancelled
CI / Test (Node 20) (pull_request) Has been cancelled
CI / Test (Node 22) (pull_request) Has been cancelled
CI / Server smoke test (pull_request) Has been cancelled
CI / Docker build (pull_request) Has been cancelled
to c1f53e597e
Some checks failed
PR rebase / Rebase onto main and arm auto-merge (pull_request) Failing after 14m27s
CI / Classify the change (pull_request) Failing after 14m30s
CI / Test (Node 18) (pull_request) Has been cancelled
CI / Test (Node 20) (pull_request) Has been cancelled
CI / Test (Node 22) (pull_request) Has been cancelled
CI / Server smoke test (pull_request) Has been cancelled
CI / Docker build (pull_request) Has been cancelled
2026-11-16 04:52:54 +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!1605
No description provided.