mirror of
https://github.com/gravitl/netmaker.git
synced 2024-11-10 17:48:25 +08:00
made server peer check more efficient
This commit is contained in:
parent
7eac05528a
commit
9f7afdcf37
1 changed files with 5 additions and 5 deletions
|
@ -232,6 +232,9 @@ func GetServerPeers(serverNode *models.Node) ([]wgtypes.PeerConfig, bool, []stri
|
|||
continue
|
||||
}
|
||||
}
|
||||
if currentNetworkACL != nil && currentNetworkACL.IsAllowed(acls.AclID(serverNode.ID), acls.AclID(node.ID)) {
|
||||
continue
|
||||
}
|
||||
|
||||
var peer wgtypes.PeerConfig
|
||||
var peeraddr = net.IPNet{
|
||||
|
@ -297,11 +300,8 @@ func GetServerPeers(serverNode *models.Node) ([]wgtypes.PeerConfig, bool, []stri
|
|||
ReplaceAllowedIPs: true,
|
||||
AllowedIPs: allowedips,
|
||||
}
|
||||
if currentNetworkACL != nil && currentNetworkACL.IsAllowed(acls.AclID(serverNode.ID), acls.AclID(node.ID)) {
|
||||
peers = append(peers, peer)
|
||||
} else { // if ACLs were not found
|
||||
peers = append(peers, peer)
|
||||
}
|
||||
|
||||
peers = append(peers, peer)
|
||||
}
|
||||
if serverNode.IsIngressGateway == "yes" {
|
||||
extPeers, err := GetServerExtPeers(serverNode)
|
||||
|
|
Loading…
Reference in a new issue