Fixed hostonly matching not respecting :name argument

This commit is contained in:
eyJhb 2017-12-25 20:49:35 +01:00
parent eae5230b5d
commit 12a6832151
1 changed files with 5 additions and 0 deletions

View File

@ -479,6 +479,11 @@ module VagrantPlugins
@env[:machine].provider.driver.read_host_only_interfaces.each do |interface| @env[:machine].provider.driver.read_host_only_interfaces.each do |interface|
return interface if config[:name] && config[:name] == interface[:name] return interface if config[:name] && config[:name] == interface[:name]
#if a config name is specified, we should only look for that.
if config[:name] != ""
next
end
if interface[:ip] != "" if interface[:ip] != ""
return interface if this_netaddr == \ return interface if this_netaddr == \
network_address(interface[:ip], interface[:netmask]) network_address(interface[:ip], interface[:netmask])