Merge pull request #1253 from mrjana/overlay
Purge vniTbl after cleaning up network sandbox
This commit is contained in:
commit
7933b04775
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue