mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-04 19:05:27 +08:00
replace read lock with write lock on acls
This commit is contained in:
parent
8019f7a28e
commit
808d2135c8
1 changed files with 2 additions and 2 deletions
|
@ -19,10 +19,10 @@ func AreNodesAllowed(networkID NetworkID, node1, node2 NodeID) bool {
|
|||
return false
|
||||
}
|
||||
var allowed bool
|
||||
acls.AclMutex.RLock()
|
||||
acls.AclMutex.Lock()
|
||||
currNetworkACLNode1 := currentNetworkACL[acls.AclID(node1)]
|
||||
currNetworkACLNode2 := currentNetworkACL[acls.AclID(node2)]
|
||||
acls.AclMutex.RUnlock()
|
||||
acls.AclMutex.Unlock()
|
||||
allowed = currNetworkACLNode1.IsAllowed(acls.AclID(node2)) && currNetworkACLNode2.IsAllowed(acls.AclID(node1))
|
||||
return allowed
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue