mirror of
https://github.com/netbirdio/netbird.git
synced 2025-08-19 03:16:58 +02:00
[client] Remove strings from allowed IPs (#3920)
This commit is contained in:
@@ -159,10 +159,10 @@ func (m *DefaultManager) setupRefCounters(useNoop bool) {
|
||||
m.allowedIPsRefCounter = refcounter.New(
|
||||
func(prefix netip.Prefix, peerKey string) (string, error) {
|
||||
// save peerKey to use it in the remove function
|
||||
return peerKey, m.wgInterface.AddAllowedIP(peerKey, prefix.String())
|
||||
return peerKey, m.wgInterface.AddAllowedIP(peerKey, prefix)
|
||||
},
|
||||
func(prefix netip.Prefix, peerKey string) error {
|
||||
if err := m.wgInterface.RemoveAllowedIP(peerKey, prefix.String()); err != nil {
|
||||
if err := m.wgInterface.RemoveAllowedIP(peerKey, prefix); err != nil {
|
||||
if !errors.Is(err, configurer.ErrPeerNotFound) && !errors.Is(err, configurer.ErrAllowedIPNotFound) {
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user