providers/virtualbox: code review comments
This commit is contained in:
parent
2b732a96c7
commit
2299715b41
|
@ -259,7 +259,7 @@ module VagrantPlugins
|
||||||
options[:ip] = "172.28.128.1" if options[:type] == :dhcp && !options[:ip]
|
options[:ip] = "172.28.128.1" if options[:type] == :dhcp && !options[:ip]
|
||||||
|
|
||||||
ip = IPAddr.new(options[:ip])
|
ip = IPAddr.new(options[:ip])
|
||||||
if !ip.ipv6?
|
if ip.ipv4?
|
||||||
options[:netmask] ||= "255.255.255.0"
|
options[:netmask] ||= "255.255.255.0"
|
||||||
|
|
||||||
# Calculate our network address for the given IP/netmask
|
# Calculate our network address for the given IP/netmask
|
||||||
|
@ -286,7 +286,7 @@ module VagrantPlugins
|
||||||
adapter_ip = ip_parts.dup
|
adapter_ip = ip_parts.dup
|
||||||
adapter_ip[3] += 1
|
adapter_ip[3] += 1
|
||||||
options[:adapter_ip] ||= adapter_ip.join(".")
|
options[:adapter_ip] ||= adapter_ip.join(".")
|
||||||
else
|
elsif ip.ipv6?
|
||||||
# Default subnet prefix length
|
# Default subnet prefix length
|
||||||
options[:netmask] ||= 64
|
options[:netmask] ||= 64
|
||||||
|
|
||||||
|
@ -295,6 +295,8 @@ module VagrantPlugins
|
||||||
|
|
||||||
# Append a 6 to the end of the type
|
# Append a 6 to the end of the type
|
||||||
options[:type] = "#{options[:type]}6".to_sym
|
options[:type] = "#{options[:type]}6".to_sym
|
||||||
|
else
|
||||||
|
raise "BUG: Unknown IP type: #{ip.inspect}"
|
||||||
end
|
end
|
||||||
|
|
||||||
dhcp_options = {}
|
dhcp_options = {}
|
||||||
|
|
|
@ -60,6 +60,8 @@ module VagrantPlugins
|
||||||
execute("hostonlyif", "ipconfig", name,
|
execute("hostonlyif", "ipconfig", name,
|
||||||
"--ipv6", options[:adapter_ip],
|
"--ipv6", options[:adapter_ip],
|
||||||
"--netmasklengthv6", options[:netmask].to_s)
|
"--netmasklengthv6", options[:netmask].to_s)
|
||||||
|
else
|
||||||
|
raise "BUG: Unknown IP type: #{ip.inspect}"
|
||||||
end
|
end
|
||||||
|
|
||||||
# Return the details
|
# Return the details
|
||||||
|
|
Loading…
Reference in New Issue