Merge pull request #1253 from mrjana/overlay

Purge vniTbl after cleaning up network sandbox
This commit is contained in:
Alessandro Boch 2016-06-13 08:08:30 -07:00 committed by GitHub
commit 7933b04775
1 changed files with 13 additions and 0 deletions

View File

@ -475,6 +475,19 @@ func (n *network) cleanupStaleSandboxes() {
deleteVxlanByVNI(path, 0)
syscall.Unmount(path, syscall.MNT_DETACH)
os.Remove(path)
// Now that we have destroyed this
// sandbox, remove all references to
// it in vniTbl so that we don't
// inadvertently destroy the sandbox
// created in this life.
networkMu.Lock()
for vni, tblPath := range vniTbl {
if tblPath == path {
delete(vniTbl, vni)
}
}
networkMu.Unlock()
}
return nil