mirror of
https://github.com/gravitl/netmaker.git
synced 2025-09-11 23:54:22 +08:00
add additional mutex lock on node acls func
This commit is contained in:
parent
3152c678e0
commit
5325f0e7d7
1 changed files with 5 additions and 0 deletions
|
@ -3,12 +3,17 @@ package nodeacls
|
|||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"sync"
|
||||
|
||||
"github.com/gravitl/netmaker/logic/acls"
|
||||
)
|
||||
|
||||
var NodesAllowedACLMutex = &sync.Mutex{}
|
||||
|
||||
// AreNodesAllowed - checks if nodes are allowed to communicate in their network ACL
|
||||
func AreNodesAllowed(networkID NetworkID, node1, node2 NodeID) bool {
|
||||
NodesAllowedACLMutex.Lock()
|
||||
defer NodesAllowedACLMutex.Unlock()
|
||||
var currentNetworkACL, err = FetchAllACLs(networkID)
|
||||
if err != nil {
|
||||
return false
|
||||
|
|
Loading…
Add table
Reference in a new issue