Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

Handle bad netmask returned by virtualbox after hostonlyif creation. Fixes #1843 #1882

Merged
merged 3 commits into from
Sep 23, 2015
Merged

Handle bad netmask returned by virtualbox after hostonlyif creation. Fixes #1843 #1882

merged 3 commits into from
Sep 23, 2015

Conversation

rwilliams
Copy link
Contributor

No description provided.

@nathanleclaire
Copy link
Contributor

If you rebase to master the grumpy CircleCI build should be fixed.

…ixes #1843

Signed-off-by: Ron Williams <ron.a.williams@gmail.com>
@rwilliams
Copy link
Contributor Author

Thanks

@nathanleclaire
Copy link
Contributor

Could I get you to write a unit test for the condition that this change is testing for?

@rwilliams
Copy link
Contributor Author

I'm pretty sure if I could get the integration tests to run on my Windows 10 machine we'd see some failures. What this change is testing for is the following bug in Virtualbox 5.0.4+

vboxmanage hostonlyif create && vboxmanage list hostonlyifs
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Interface 'VirtualBox Host-Only Ethernet Adapter #3' was successfully created
Name:            VirtualBox Host-Only Ethernet Adapter #3
GUID:            336f5edf-a838-43a1-a55f-7955e605ee59
DHCP:            Enabled
IPAddress:       192.168.56.1
NetworkMask:     15.0.0.0
IPV6Address:     fe80:0000:0000:0000:384b:5e06:3257:bdb1
IPV6NetworkMaskPrefixLength: 64
HardwareAddress: 0a:00:27:00:00:00
MediumType:      Ethernet
Status:          Up
VBoxNetworkName: HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter #3

The network mask on a newly created host only adapter if always returns 15.0.0.0, if list hostonlyifs is called right away, which leads to docker-machine creating a 2nd host only adapter and breaking the vm creation process

@nathanleclaire
Copy link
Contributor

Mm, rough. So this fixes the issue by allowing Machine to correctly detect the created host only network?

@rwilliams
Copy link
Contributor Author

Correct.

@nathanleclaire
Copy link
Contributor

OK great, I have written some tests for this and the surrounding code and I'm going to make a PR to your repo that you should merge in for this PR.

@nathanleclaire
Copy link
Contributor

Please merge: https://github.com/rwilliams/machine/pull/1/files

After that, LGTM

Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
…stonlyif

Add tests for host only network retrieval feature

Signed-off-by: Ron Williams <ron.a.williams@gmail.com>
@rwilliams
Copy link
Contributor Author

Awesome

@nathanleclaire
Copy link
Contributor

LGTM

nathanleclaire added a commit that referenced this pull request Sep 23, 2015
Handle bad netmask returned by virtualbox after hostonlyif creation. Fixes #1843
@nathanleclaire nathanleclaire merged commit 4ced2d8 into docker:master Sep 23, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants