Merge pull request #1381 from LK4D4/fix_overlay_race

overlay: fix data race in map access
This commit is contained in:
Jana Radhakrishnan 2016-08-05 16:16:27 -07:00 committed by GitHub
commit e5bf276745
1 changed files with 4 additions and 4 deletions

View File

@ -664,17 +664,17 @@ func (d *driver) deleteNetwork(nid string) {
func (d *driver) network(nid string) *network {
d.Lock()
networks := d.networks
n, ok := d.networks[nid]
d.Unlock()
n, ok := networks[nid]
if !ok {
n = d.getNetworkFromStore(nid)
if n != nil {
n.driver = d
n.endpoints = endpointTable{}
n.once = &sync.Once{}
networks[nid] = n
d.Lock()
d.networks[nid] = n
d.Unlock()
}
}