fix(network): Take down all interfaces properly

The map of interfaces wasn't being populated correctly. Also, clean up some prints.
This commit is contained in:
Alex Crawford
2014-06-11 23:20:59 -07:00
parent 159f4a2c7c
commit 16d7e8af48
2 changed files with 9 additions and 7 deletions

View File

@@ -36,7 +36,9 @@ func downNetworkInterfaces(interfaces []network.InterfaceGenerator) error {
sysInterfaceMap := make(map[string]*net.Interface)
if systemInterfaces, err := net.Interfaces(); err == nil {
for _, iface := range systemInterfaces {
sysInterfaceMap[iface.Name] = &iface
// Need a copy of the interface so we can take the address
temp := iface
sysInterfaceMap[temp.Name] = &temp
}
} else {
return err