Skip to content

Commit

Permalink
Handle bad netmask returned by virtualbox after hostonlyif creation. F…
Browse files Browse the repository at this point in the history
…ixes docker#1843

Signed-off-by: Ron Williams <ron.a.williams@gmail.com>
  • Loading branch information
rwilliams committed Sep 21, 2015
1 parent 0540e5e commit 0b5f4c8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/virtualbox/network.go
Expand Up @@ -127,8 +127,11 @@ func getHostOnlyNetwork(hostIP net.IP, netmask net.IPMask) (*hostOnlyNetwork, er
return nil, err
}
for _, n := range nets {
//handle known issue where vbox throws us a bad netmask
//if the value returned is "0f000000" it's the newly
//created adpater and should be the right one
if hostIP.Equal(n.IPv4.IP) &&
netmask.String() == n.IPv4.Mask.String() {
(netmask.String() == n.IPv4.Mask.String() || n.IPv4.Mask.String() == "0f000000") {
return n, nil
}
}
Expand Down

0 comments on commit 0b5f4c8

Please sign in to comment.