mirror of
https://github.com/netbirdio/netbird.git
synced 2026-03-31 06:24:18 -04:00
Extend protocol and firewall manager to handle old management (#915)
* Extend protocol and firewall manager to handle old management * Send correct empty firewall rules list when delete peer * Add extra tests for firewall manager and uspfilter * Work with inconsistent state * Review note * Update comment
This commit is contained in:
committed by
GitHub
parent
45a6263adc
commit
293499c3c0
@@ -242,6 +242,9 @@ func (a *Account) connResourcesGenerator() (func(*PolicyRule, []*Peer, int), fun
|
||||
peers := make([]*Peer, 0)
|
||||
return func(rule *PolicyRule, groupPeers []*Peer, direction int) {
|
||||
for _, peer := range groupPeers {
|
||||
if peer == nil {
|
||||
continue
|
||||
}
|
||||
if _, ok := peersExists[peer.ID]; !ok {
|
||||
peers = append(peers, peer)
|
||||
peersExists[peer.ID] = struct{}{}
|
||||
@@ -457,8 +460,8 @@ func getAllPeersFromGroups(account *Account, groups []string, peerID string) ([]
|
||||
}
|
||||
|
||||
for _, p := range group.Peers {
|
||||
peer := account.Peers[p]
|
||||
if peer.ID == peerID {
|
||||
peer, ok := account.Peers[p]
|
||||
if ok && peer != nil && peer.ID == peerID {
|
||||
peerInGroups = true
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user