[PR #5837] [management] Reconcile IPv6 addresses on group membership changes #28621

Open
opened 2026-08-05 08:06:39 -04:00 by saavagebueno · 0 comments
Owner

Original Pull Request: https://github.com/netbirdio/netbird/pull/5837

State: closed
Merged: Yes


Describe your changes

IPv6 overlay addresses were only assigned/removed in AddPeer (first registration) and SaveAccountSettings (when admin changes IPv6 settings). If a peer was added to or removed from an IPv6-enabled group after registration, its IPv6 address was never updated.

  • Add reconcileIPv6ForGroupChanges that checks if changed group IDs overlap with IPv6EnabledGroups, and if so runs the existing full updatePeerIPv6Addresses reconciliation
  • Wire it into all group membership mutation paths: UpdateGroup, UpdateGroups, GroupAddPeer, GroupDeletePeer, DeleteGroups, propagateUserGroupMemberships, SyncUserJWTGroups, and user auto-group changes
  • Change propagateUserGroupMemberships from standalone function to method on DefaultAccountManager so it can call the reconciler
  • Fix append aliasing bug in SyncUserJWTGroups and processUserUpdate where append(removedGroups, addedGroups...) could mutate the first slice

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

Documentation

Select exactly one:

  • I added/updated documentation for this change
  • Documentation is not needed for this change (explain why)

Summary by CodeRabbit

  • Improvements
    • IPv6 address management is now automatically synchronized when group memberships change, ensuring consistent address assignment and removal.
    • IPv6-enabled groups properly reconcile peer IPv6 addresses during all group operations, including adding/removing peers and updating group configurations.
    • Enhanced handling of IPv6 addresses across user group updates.
**Original Pull Request:** https://github.com/netbirdio/netbird/pull/5837 **State:** closed **Merged:** Yes --- ## Describe your changes IPv6 overlay addresses were only assigned/removed in AddPeer (first registration) and SaveAccountSettings (when admin changes IPv6 settings). If a peer was added to or removed from an IPv6-enabled group after registration, its IPv6 address was never updated. - Add `reconcileIPv6ForGroupChanges` that checks if changed group IDs overlap with IPv6EnabledGroups, and if so runs the existing full `updatePeerIPv6Addresses` reconciliation - Wire it into all group membership mutation paths: UpdateGroup, UpdateGroups, GroupAddPeer, GroupDeletePeer, DeleteGroups, propagateUserGroupMemberships, SyncUserJWTGroups, and user auto-group changes - Change `propagateUserGroupMemberships` from standalone function to method on DefaultAccountManager so it can call the reconciler - Fix `append` aliasing bug in SyncUserJWTGroups and processUserUpdate where `append(removedGroups, addedGroups...)` could mutate the first slice ## Issue ticket number and link ## Stack <!-- branch-stack --> ### Checklist - [ ] Is it a bug fix - [ ] Is a typo/documentation fix - [x] Is a feature enhancement - [ ] It is a refactor - [x] Created tests that fail without the change (if possible) > By submitting this pull request, you confirm that you have read and agree to the terms of the [Contributor License Agreement](https://github.com/netbirdio/netbird/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT.md). ## Documentation Select exactly one: - [ ] I added/updated documentation for this change - [x] Documentation is **not needed** for this change (explain why) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Improvements** * IPv6 address management is now automatically synchronized when group memberships change, ensuring consistent address assignment and removal. * IPv6-enabled groups properly reconcile peer IPv6 addresses during all group operations, including adding/removing peers and updating group configurations. * Enhanced handling of IPv6 addresses across user group updates. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
saavagebueno added the pull-request label 2026-08-05 08:06:39 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#28621