From f53238d253f27a04174507933ef6fb038aab7591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20F=C3=A9lizard?= Date: Mon, 19 Feb 2018 13:47:48 +0000 Subject: [PATCH] Skip link-local addresses when fixing IPv6 route This occurs with a Linux host when a link-local address is configured for vboxnet0 (which is the default for VirtualBox 5.2.6). `connect': Invalid argument - connect(2) for "fe80::ffff:ffff:ffff:ffff" port 80 (Errno::EINVAL) --- plugins/providers/virtualbox/action/network_fix_ipv6.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/providers/virtualbox/action/network_fix_ipv6.rb b/plugins/providers/virtualbox/action/network_fix_ipv6.rb index be5468d88..33bcf3e98 100644 --- a/plugins/providers/virtualbox/action/network_fix_ipv6.rb +++ b/plugins/providers/virtualbox/action/network_fix_ipv6.rb @@ -43,6 +43,7 @@ module VagrantPlugins # If we have no IPv6, forget it return if !has_v6 + link_local_range = IPAddr.new("fe80::/10") host_only_interfaces(env).each do |interface| next if !present?(interface[:ipv6]) next if interface[:status] != "Up" @@ -50,6 +51,8 @@ module VagrantPlugins ip = IPAddr.new(interface[:ipv6]) ip |= ("1" * (128 - interface[:ipv6_prefix].to_i)).to_i(2) + next if link_local_range.include?(ip) + @logger.info("testing IPv6: #{ip}") begin