fix(multiuser): prevent duplicate /64 mycelium slot allocation (#164) #180

Merged
omarz merged 1 commit from fix-issue-164-duplicate-mycelium-ip into development 2026-04-30 12:08:10 +00:00
Member

The slot allocator only consulted mycelium's managed-address list, while
bridge_assign_user_ip silently fell back to ip addr add when the RPC
failed. Together these let the kernel and mycelium drift, so subsequent
multi_user_add calls reused an already-occupied slot — producing two
bridges sharing 4a0:6976:8fa7:efc:1::1/64.

  • mycelium_alloc_prefix64 now unions mycelium's view with a kernel scan
    (kernel_occupied_slots), via a shared slot_from_addr helper.
  • bridge_assign_user_ip drops the silent ip addr add fallback; mycelium
    failures now error explicitly.
  • multi_user_add detects when an existing bridge's slot is also live on
    another interface, tears that bridge down, and reallocates. Also
    removes stray kernel bridges that mycelium lost track of before
    fresh allocation.
  • multi_user_del removes residual kernel bridges that mycelium's delete
    did not (or could not) clean up.
The slot allocator only consulted mycelium's managed-address list, while bridge_assign_user_ip silently fell back to `ip addr add` when the RPC failed. Together these let the kernel and mycelium drift, so subsequent multi_user_add calls reused an already-occupied slot — producing two bridges sharing 4a0:6976:8fa7:efc:1::1/64. - mycelium_alloc_prefix64 now unions mycelium's view with a kernel scan (kernel_occupied_slots), via a shared slot_from_addr helper. - bridge_assign_user_ip drops the silent ip addr add fallback; mycelium failures now error explicitly. - multi_user_add detects when an existing bridge's slot is also live on another interface, tears that bridge down, and reallocates. Also removes stray kernel bridges that mycelium lost track of before fresh allocation. - multi_user_del removes residual kernel bridges that mycelium's delete did not (or could not) clean up.
fix(multiuser): prevent duplicate /64 mycelium slot allocation (#164)
All checks were successful
Build and Publish Skills / build-and-publish (pull_request) Successful in 3s
684f920766
The slot allocator only consulted mycelium's managed-address list, while
bridge_assign_user_ip silently fell back to `ip addr add` when the RPC
failed. Together these let the kernel and mycelium drift, so subsequent
multi_user_add calls reused an already-occupied slot — producing two
bridges sharing 4a0:6976:8fa7:efc:1::1/64.

- mycelium_alloc_prefix64 now unions mycelium's view with a kernel scan
  (kernel_occupied_slots), via a shared slot_from_addr helper.
- bridge_assign_user_ip drops the silent ip addr add fallback; mycelium
  failures now error explicitly.
- multi_user_add detects when an existing bridge's slot is also live on
  another interface, tears that bridge down, and reallocates. Also
  removes stray kernel bridges that mycelium lost track of before
  fresh allocation.
- multi_user_del removes residual kernel bridges that mycelium's delete
  did not (or could not) clean up.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
omarz merged commit 3eb321f9fc into development 2026-04-30 12:08:10 +00:00
omarz deleted branch fix-issue-164-duplicate-mycelium-ip 2026-04-30 12:08:10 +00:00
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
lhumina_code/hero_skills!180
No description provided.