From afb6c205819443e42ec0c3e15fa0b389257e3b97 Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Tue, 19 Mar 2019 14:03:03 -0700 Subject: [PATCH] Fix option mask to be expected netmask --- plugins/providers/docker/action/prepare_networks.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/providers/docker/action/prepare_networks.rb b/plugins/providers/docker/action/prepare_networks.rb index 2815eccd3..68145f1ef 100644 --- a/plugins/providers/docker/action/prepare_networks.rb +++ b/plugins/providers/docker/action/prepare_networks.rb @@ -102,22 +102,22 @@ module VagrantPlugins # If no mask is provided, attempt to locate any existing # network which contains the assigned IP address - if !root_options[:mask] && !network_name + if !root_options[:netmask] && !network_name network_name = env[:machine].provider.driver. network_containing_address(root_options[:ip]) # When no existing network is found, we are creating # a new network. Since no mask was provided, default # to /24 for ipv4 and /64 for ipv6 if !network_name - root_options[:mask] = addr.ipv4? ? 24 : 64 + root_options[:netmask] = addr.ipv4? ? 24 : 64 end end # With no network name, process options to find or determine # name for new network if !network_name - subnet = IPAddr.new("#{root_options[:ip]}/#{root_options[:mask]}") - network = "#{subnet}/#{root_options[:mask]}" + subnet = IPAddr.new("#{root_options[:ip]}/#{root_options[:netmask]}") + network = "#{subnet}/#{root_options[:netmask]}" network_options[:subnet] = network existing_network = env[:machine].provider.driver. network_defined?(network)