1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Have resources initialized before deleting overlay network

- Otherwise a overlay network delete after daemon restart
  will hit a nil pointer dereference while releasing the
  vxlan id

Signed-off-by: Alessandro Boch <aboch@docker.com>
This commit is contained in:
Alessandro Boch 2016-04-04 11:24:07 -07:00
parent d0cfd9b3dd
commit 0e7a19521c

View file

@ -104,6 +104,11 @@ func (d *driver) DeleteNetwork(nid string) error {
return fmt.Errorf("invalid network id") return fmt.Errorf("invalid network id")
} }
// Make sure driver resources are initialized before proceeding
if err := d.configure(); err != nil {
return err
}
n := d.network(nid) n := d.network(nid)
if n == nil { if n == nil {
return fmt.Errorf("could not find network with id %s", nid) return fmt.Errorf("could not find network with id %s", nid)