mirror of
https://github.com/gravitl/netmaker.git
synced 2025-11-17 22:48:49 +08:00
moved acl check
This commit is contained in:
parent
52c7a5897a
commit
8ab7266c30
1 changed files with 5 additions and 1 deletions
|
|
@ -53,6 +53,10 @@ func GetNodePeers(networkName, nodeid string, excludeRelayed bool, isP2S bool) (
|
|||
}
|
||||
|
||||
for _, node := range networkNodes {
|
||||
if !currentNetworkACLs.IsAllowed(acls.AclID(nodeid), acls.AclID(node.ID)) {
|
||||
continue
|
||||
}
|
||||
|
||||
var peer = models.Node{}
|
||||
if node.IsEgressGateway == "yes" { // handle egress stuff
|
||||
peer.EgressGatewayRanges = node.EgressGatewayRanges
|
||||
|
|
@ -86,7 +90,7 @@ func GetNodePeers(networkName, nodeid string, excludeRelayed bool, isP2S bool) (
|
|||
}
|
||||
}
|
||||
}
|
||||
if (!isP2S || peer.IsHub == "yes") && currentNetworkACLs.IsAllowed(acls.AclID(nodeid), acls.AclID(node.ID)) {
|
||||
if !isP2S || peer.IsHub == "yes" {
|
||||
peers = append(peers, peer)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue